diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index 0a9be6de70..bf965c7d34 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -145,7 +145,7 @@ ARDOUR_UI::setup_windows () setup_toplevel_window (_main_window, "", this); rc_option_editor = new RCOptionEditor; - rc_option_editor->add_to_notebook (_tabs, _("Preferences"), 2); + rc_option_editor->add_to_notebook (_tabs, _("Preferences")); rc_option_editor->contents().show_all (); _tabs.signal_switch_page().connect (sigc::mem_fun (*this, &ARDOUR_UI::tabs_switch)); diff --git a/gtk2_ardour/ardour_ui_dependents.cc b/gtk2_ardour/ardour_ui_dependents.cc index b99cc24db9..4d50787852 100644 --- a/gtk2_ardour/ardour_ui_dependents.cc +++ b/gtk2_ardour/ardour_ui_dependents.cc @@ -61,8 +61,8 @@ ARDOUR_UI::we_have_dependents () editor->setup_tooltips (); editor->UpdateAllTransportClocks.connect (sigc::mem_fun (*this, &ARDOUR_UI::update_transport_clocks)); - editor->add_to_notebook (_tabs, _("Editor"), 1); - mixer->add_to_notebook (_tabs, _("Mixer"), 1); + editor->add_to_notebook (_tabs, _("Editor")); + mixer->add_to_notebook (_tabs, _("Mixer")); /* all actions are defined */ diff --git a/libs/gtkmm2ext/gtkmm2ext/tabbable.h b/libs/gtkmm2ext/gtkmm2ext/tabbable.h index 5ed0eeb843..f30cb4d40f 100644 --- a/libs/gtkmm2ext/gtkmm2ext/tabbable.h +++ b/libs/gtkmm2ext/gtkmm2ext/tabbable.h @@ -39,7 +39,7 @@ class LIBGTKMM2EXT_API Tabbable : public WindowProxy { Tabbable (Gtk::Widget&, const std::string&); ~Tabbable (); - void add_to_notebook (Gtk::Notebook& notebook, const std::string& tab_title, int position); + void add_to_notebook (Gtk::Notebook& notebook, const std::string& tab_title); void show_tab (); Gtk::Widget& contents() const { return _contents; } @@ -72,7 +72,6 @@ class LIBGTKMM2EXT_API Tabbable : public WindowProxy { Gtk::Notebook _own_notebook; Gtk::Notebook* _parent_notebook; std::string _tab_title; - int _notebook_position; }; } diff --git a/libs/gtkmm2ext/tabbable.cc b/libs/gtkmm2ext/tabbable.cc index 245be5542f..4249da7fff 100644 --- a/libs/gtkmm2ext/tabbable.cc +++ b/libs/gtkmm2ext/tabbable.cc @@ -22,6 +22,7 @@ #include #include "gtkmm2ext/tabbable.h" +#include "gtkmm2ext/gtk_ui.h" #include "gtkmm2ext/visibility_tracker.h" #include "i18n.h" @@ -45,15 +46,22 @@ Tabbable::~Tabbable () } void -Tabbable::add_to_notebook (Notebook& notebook, const string& tab_title, int position) +Tabbable::add_to_notebook (Notebook& notebook, const string& tab_title) { - notebook.insert_page (_contents, tab_title, position, false); + notebook.append_page (_contents, tab_title, false); + Gtk::Widget* tab_label = notebook.get_tab_label (_contents); + + if (tab_label) { + Gtkmm2ext::UI::instance()->set_tip (*tab_label, + string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n" + "To put the window back, click on its \"close\" button"), tab_title)); + } + notebook.set_tab_detachable (_contents); notebook.set_tab_reorderable (_contents); _parent_notebook = ¬ebook; _tab_title = tab_title; - _notebook_position = position; } Window* @@ -181,7 +189,7 @@ Tabbable::delete_event_handler (GdkEventAny *ev) if (_parent_notebook) { - _parent_notebook->insert_page (_contents, _tab_title, _notebook_position); + _parent_notebook->append_page (_contents, _tab_title); _parent_notebook->set_tab_detachable (_contents); _parent_notebook->set_tab_reorderable (_contents); _parent_notebook->set_current_page (_parent_notebook->page_num (_contents));