summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-07-09 13:27:39 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-02-22 15:31:21 -0500
commitd84f6554957acf16e9f835c435904b8b3069c8b1 (patch)
tree93285d6313c770963c2b1e2fe8c9f31623a4835f
parent39036cf20fc8e27d3d1ee9c5070584356285abc2 (diff)
add suggestive tooltips for tabs; remove position argument for Tabbable since it isn't really usable
-rw-r--r--gtk2_ardour/ardour_ui2.cc2
-rw-r--r--gtk2_ardour/ardour_ui_dependents.cc4
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/tabbable.h3
-rw-r--r--libs/gtkmm2ext/tabbable.cc16
4 files changed, 16 insertions, 9 deletions
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 <gtkmm/window.h>
#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 = &notebook;
_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));