From 1e537cb53905509eead1c552d012d99982619ec3 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 18 Nov 2015 23:03:16 -0500 Subject: remove tab-related code for tabbed notebook, add tooltips to new buttons --- gtk2_ardour/ardour_ui.h | 2 -- gtk2_ardour/ardour_ui2.cc | 36 ------------------------------------ gtk2_ardour/ardour_ui_dependents.cc | 9 --------- gtk2_ardour/ardour_ui_dialogs.cc | 4 ++-- gtk2_ardour/ardour_ui_ed.cc | 12 ++++++++++++ 5 files changed, 14 insertions(+), 49 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index e9236adda4..d681394d84 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -372,8 +372,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr bool _initial_verbose_plugin_scan; bool first_time_engine_run; - bool tabs_button_event (GdkEventButton* ev); - void show_tabbable (Gtkmm2ext::Tabbable*); void hide_tabbable (Gtkmm2ext::Tabbable*); void detach_tabbable (Gtkmm2ext::Tabbable*); diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index 2623cc8ca9..4d05bca0d8 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -68,42 +68,6 @@ using namespace Glib; using namespace ARDOUR_UI_UTILS; -bool -ARDOUR_UI::tabs_button_event (GdkEventButton* ev) -{ - std::vector children = _tabs.get_children(); - - for (std::vector::iterator w = children.begin(); w != children.end(); ++w) { - - Gtk::Widget* close_button = reinterpret_cast ((*w)->get_data ("close-button")); - - if (close_button) { - - Gtk::Allocation alloc (close_button->get_allocation()); - int dx, dy; - - /* Allocation origin uses toplevel window coordinates; - * event origin uses _tabs-centric coordinate space, so - * translate before computing if event is inside the - * close button. - */ - - close_button->get_toplevel()->translate_coordinates (_tabs, alloc.get_x(), alloc.get_y(), dx, dy); - - if (ev->x >= dx && - ev->y >= dy && - ev->x < dx + alloc.get_width() && - ev->y < dy + alloc.get_height()) { - if (close_button->event ((GdkEvent*) ev)) { - return true; - } - } - } - } - - return false; -} - void ARDOUR_UI::setup_tooltips () { diff --git a/gtk2_ardour/ardour_ui_dependents.cc b/gtk2_ardour/ardour_ui_dependents.cc index b194f3ca89..90e2fd8428 100644 --- a/gtk2_ardour/ardour_ui_dependents.cc +++ b/gtk2_ardour/ardour_ui_dependents.cc @@ -233,15 +233,6 @@ ARDOUR_UI::setup_windows () keyboard->setup_keybindings (); - /* we don't use a widget with its own window for the tab close button, - which makes it impossible to rely on GTK+ to generate signals for - events occuring "in" this widget. Instead, we pre-connect a - handler to the relevant events on the notebook and then check - to see if the event coordinates tell us that it occured "in" - the close button. - */ - _tabs.signal_button_press_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::tabs_button_event), false); - _tabs.signal_button_release_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::tabs_button_event), false); _tabs.signal_switch_page().connect (sigc::mem_fun (*this, &ARDOUR_UI::tabs_switch)); rc_option_editor = new RCOptionEditor; diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index 6fdd3d7ef7..d40195b303 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -367,7 +367,7 @@ ARDOUR_UI::detach_tabbable (Tabbable* t) void ARDOUR_UI::tabs_switch (GtkNotebookPage*, guint page) { - if (page == _tabs.page_num (editor->contents())) { + if (page == (guint) _tabs.page_num (editor->contents())) { editor_visibility_button.set_active_state (Gtkmm2ext::ImplicitActive); if (mixer && (mixer->tabbed() || mixer->tabbed_by_default())) { mixer_visibility_button.set_active_state (Gtkmm2ext::Off); @@ -375,7 +375,7 @@ ARDOUR_UI::tabs_switch (GtkNotebookPage*, guint page) if (rc_option_editor && (rc_option_editor->tabbed() || rc_option_editor->tabbed_by_default())) { prefs_visibility_button.set_active_state (Gtkmm2ext::Off); } - } else if (page == _tabs.page_num (mixer->contents())) { + } else if (page == (guint) _tabs.page_num (mixer->contents())) { if (editor && (editor->tabbed() || editor->tabbed_by_default())) { editor_visibility_button.set_active_state (Gtkmm2ext::Off); } diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 15b129ef89..a8900fd028 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -587,6 +587,18 @@ ARDOUR_UI::build_menu_bar () prefs_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("show-preferences"))); prefs_visibility_button.set_name (X_("page switch button")); + Gtkmm2ext::UI::instance()->set_tip (editor_visibility_button, + string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n" + "To put the window back, use the Window > %1 > Attach menu action"), editor->name())); + + Gtkmm2ext::UI::instance()->set_tip (mixer_visibility_button, + string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n" + "To put the window back, use the Window > %1 > Attach menu action"), mixer->name())); + + Gtkmm2ext::UI::instance()->set_tip (prefs_visibility_button, + string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n" + "To put the window back, use the Window > %1 > Attach menu action"), rc_option_editor->name())); + window_button_box->pack_start (editor_visibility_button, false, false); window_button_box->pack_start (mixer_visibility_button, false, false); window_button_box->pack_start (prefs_visibility_button, false, false); -- cgit v1.2.3