diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-07-25 09:18:32 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-02-22 15:31:23 -0500 |
commit | 077bb13e94ee08bf4f56e8fc98087f82163ff6b3 (patch) | |
tree | 2659452f0fca36c6a4eed2a60cde1b6fdf00f40f /libs | |
parent | 1bdf6d8a68ce5ff18071b0a5a0d9e1d7f85dce08 (diff) |
extend API for tabbable visibility management
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gtkmm2ext/gtkmm2ext/tabbable.h | 6 | ||||
-rw-r--r-- | libs/gtkmm2ext/tabbable.cc | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/libs/gtkmm2ext/gtkmm2ext/tabbable.h b/libs/gtkmm2ext/gtkmm2ext/tabbable.h index 252d86421d..9929d3f4b5 100644 --- a/libs/gtkmm2ext/gtkmm2ext/tabbable.h +++ b/libs/gtkmm2ext/gtkmm2ext/tabbable.h @@ -57,15 +57,15 @@ class LIBGTKMM2EXT_API Tabbable : public WindowProxy { virtual Gtk::Window* use_own_window (bool and_pack_it); bool has_own_window () const; - bool is_tabbed () const; void set_default_tabbed (bool yn); virtual void show_window (); - bool window_visible (); + bool window_visible () const; bool tabbed() const; - + bool tabbed_by_default () const; + Gtk::Window* current_toplevel () const; Gtk::Notebook* tab_root_drop (); diff --git a/libs/gtkmm2ext/tabbable.cc b/libs/gtkmm2ext/tabbable.cc index 720c9df9ca..3c875f4a80 100644 --- a/libs/gtkmm2ext/tabbable.cc +++ b/libs/gtkmm2ext/tabbable.cc @@ -96,9 +96,9 @@ Tabbable::use_own_window (bool and_pack_it) } bool -Tabbable::window_visible () +Tabbable::window_visible () const { - if (!own_window()) { + if (!_window) { return false; } @@ -155,6 +155,8 @@ Tabbable::show_own_window (bool and_pack_it) _window->set_default_size (alloc.get_width(), alloc.get_height()); } + tab_requested_by_state = false; + _window->show_all (); _window->present (); } @@ -271,15 +273,13 @@ Tabbable::delete_event_handler (GdkEventAny *ev) } bool -Tabbable::is_tabbed () const +Tabbable::tabbed () const { - Window* toplevel = (Window*) _contents.get_toplevel(); - - if (_window && (toplevel == _window)) { + if (_window && (current_toplevel() == _window)) { return false; } - if (_parent_notebook && _contents.get_parent()) { + if (_parent_notebook && (_parent_notebook->page_num (_contents) >= 0)) { return true; } @@ -320,9 +320,9 @@ Tabbable::xml_node_name() } bool -Tabbable::tabbed () const +Tabbable::tabbed_by_default() const { - return _parent_notebook && (_parent_notebook->page_num (_contents) >= 0); + return tab_requested_by_state; } XMLNode& |