summaryrefslogtreecommitdiff
path: root/libs/gtkmm2ext/tearoff.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-12-12 14:43:24 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-12-12 14:43:24 +0000
commitbc89fe0147c04b67141936d109c00dfd4d69cc4b (patch)
tree544ff450c40fe1f43853a8420228a26f27f1eafb /libs/gtkmm2ext/tearoff.cc
parent30daaebaa2d90d6b0e8673143ccc3cacd7bd1753 (diff)
most of the 2.X->3.0 commit (up to rev 4299) except for gtk2_ardour/editor_canvas.cc; builds and runs and does a few specific things but expect it to be buggy for a while yet
git-svn-id: svn://localhost/ardour2/branches/3.0@4313 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/gtkmm2ext/tearoff.cc')
-rw-r--r--libs/gtkmm2ext/tearoff.cc33
1 files changed, 26 insertions, 7 deletions
diff --git a/libs/gtkmm2ext/tearoff.cc b/libs/gtkmm2ext/tearoff.cc
index 92bde5541e..be3bfe4113 100644
--- a/libs/gtkmm2ext/tearoff.cc
+++ b/libs/gtkmm2ext/tearoff.cc
@@ -36,6 +36,7 @@ TearOff::TearOff (Widget& c, bool allow_resize)
{
dragging = false;
_visible = true;
+ _can_be_torn_off = true;
tearoff_event_box.add (tearoff_arrow);
tearoff_event_box.set_events (BUTTON_PRESS_MASK|BUTTON_RELEASE_MASK);
@@ -79,6 +80,21 @@ TearOff::~TearOff ()
}
void
+TearOff::set_can_be_torn_off (bool yn)
+{
+ if (yn != _can_be_torn_off) {
+ if (yn) {
+ tearoff_arrow.set_no_show_all (false);
+ tearoff_arrow.show ();
+ } else {
+ tearoff_arrow.set_no_show_all (true);
+ tearoff_arrow.hide ();
+ }
+ _can_be_torn_off = yn;
+ }
+}
+
+void
TearOff::set_visible (bool yn)
{
/* don't change visibility if torn off */
@@ -102,13 +118,16 @@ TearOff::set_visible (bool yn)
gint
TearOff::tearoff_click (GdkEventButton* ev)
{
- remove (contents);
- window_box.pack_start (contents);
- own_window.set_name (get_name());
- close_event_box.set_name (get_name());
- own_window.show_all ();
- hide ();
- Detach ();
+ if (_can_be_torn_off) {
+ remove (contents);
+ window_box.pack_start (contents);
+ own_window.set_name (get_name());
+ close_event_box.set_name (get_name());
+ own_window.show_all ();
+ hide ();
+ Detach ();
+ }
+
return true;
}