From 244eaa55fb8c67f7e0d96ed772b09061d2249e61 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 9 Nov 2011 20:10:05 +0000 Subject: [PATCH] provide global prelight option (its in Edit -> Preferences->Interface) git-svn-id: svn://localhost/ardour2/branches/3.0@10514 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour3_widget_list.rc | 2 +- gtk2_ardour/ardour_button.cc | 8 +++++--- gtk2_ardour/ardour_button.h | 1 - gtk2_ardour/ardour_ui.cc | 11 ++--------- gtk2_ardour/rc_option_editor.cc | 8 ++++++++ libs/ardour/ardour/rc_configuration_vars.h | 1 + tools/fmt-bindings | 2 +- 7 files changed, 18 insertions(+), 15 deletions(-) diff --git a/gtk2_ardour/ardour3_widget_list.rc b/gtk2_ardour/ardour3_widget_list.rc index cd1da33487..bfb9ae5bf8 100644 --- a/gtk2_ardour/ardour3_widget_list.rc +++ b/gtk2_ardour/ardour3_widget_list.rc @@ -392,4 +392,4 @@ widget "*MonitorSectionLabel" style:highest "very_small_text" widget "*mute button" style:highest "small_text" widget "*send alert button" style:highest "small_text" widget "*solo button" style:highest "small_text" -widget "*transport option button" style:highest "small_text" +widget "*transport option button" style:highest "very_small_text" diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc index 9d7d3aa728..c6b89e7b7c 100644 --- a/gtk2_ardour/ardour_button.cc +++ b/gtk2_ardour/ardour_button.cc @@ -30,6 +30,8 @@ #include "gtkmm2ext/rgb_macros.h" #include "gtkmm2ext/gui_thread.h" +#include "ardour/rc_configuration.h" // for widget prelight preference + #include "ardour_button.h" #include "ardour_ui.h" #include "global_signals.h" @@ -246,7 +248,7 @@ ArdourButton::render (cairo_t* cr) /* if requested, show hovering */ - if ((_tweaks & ShowHover)) { + if (ARDOUR::Config->get_widget_prelight()) { if (_hovering) { Gtkmm2ext::rounded_rectangle (cr, 0, 0, _width, _height, _corner_radius); cairo_set_source_rgba (cr, 0.905, 0.917, 0.925, 0.2); @@ -634,7 +636,7 @@ ArdourButton::on_enter_notify_event (GdkEventCrossing* ev) { _hovering = true; - if (_tweaks & ShowHover) { + if (ARDOUR::Config->get_widget_prelight()) { queue_draw (); } @@ -646,7 +648,7 @@ ArdourButton::on_leave_notify_event (GdkEventCrossing* ev) { _hovering = false; - if (_tweaks & ShowHover) { + if (ARDOUR::Config->get_widget_prelight()) { queue_draw (); } diff --git a/gtk2_ardour/ardour_button.h b/gtk2_ardour/ardour_button.h index e1f5f80bd4..0cee4092ae 100644 --- a/gtk2_ardour/ardour_button.h +++ b/gtk2_ardour/ardour_button.h @@ -50,7 +50,6 @@ class ArdourButton : public CairoWidget enum Tweaks { ShowClick = 0x1, - ShowHover = 0x2, NoModel = 0x4, }; diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 156125e01c..e2da245499 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -237,15 +237,8 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) rec_button.set_name ("transport recenable button"); join_play_range_button.set_name ("transport button"); - roll_button.set_tweaks (ArdourButton::ShowHover); - stop_button.set_tweaks (ArdourButton::ShowHover); - auto_loop_button.set_tweaks (ArdourButton::ShowHover); - play_selection_button.set_tweaks (ArdourButton::ShowHover); - rec_button.set_tweaks (ArdourButton::ShowHover); - join_play_range_button.set_tweaks (ArdourButton::ShowHover); - - goto_start_button.set_tweaks (ArdourButton::Tweaks(ArdourButton::ShowClick|ArdourButton::ShowHover)); - goto_end_button.set_tweaks (ArdourButton::Tweaks(ArdourButton::ShowClick|ArdourButton::ShowHover)); + goto_start_button.set_tweaks (ArdourButton::ShowClick); + goto_end_button.set_tweaks (ArdourButton::ShowClick); last_configure_time= 0; last_peak_grab = 0; diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 31cbba521b..5e7df484ea 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -1493,6 +1493,14 @@ RCOptionEditor::RCOptionEditor () /* INTERFACE */ + add_option (_("Interface"), + new BoolOption ( + "widget_prelight", + _("Graphically indicate mouse pointer hovering over various widgets"), + sigc::mem_fun (*_rc_config, &RCConfiguration::get_widget_prelight), + sigc::mem_fun (*_rc_config, &RCConfiguration::set_widget_prelight) + )); + #ifndef GTKOSX /* font scaling does nothing with GDK/Quartz */ add_option (_("Interface"), new FontScalingOptions (_rc_config)); diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index a56a3f9efd..9d3ed23cb4 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -177,4 +177,5 @@ CONFIG_VARIABLE (DenormalModel, denormal_model, "denormal-model", DenormalNone) /* visibility of various things */ CONFIG_VARIABLE (bool, show_zoom_tools, "show-zoom-tools", true) +CONFIG_VARIABLE (bool, widget_prelight, "widget-prelight", true) CONFIG_VARIABLE (std::string, mixer_strip_visibility, "mixer-strip-visibility", "PhaseInvert,SoloSafe,SoloIsolated,Group,MeterPoint") diff --git a/tools/fmt-bindings b/tools/fmt-bindings index c9184f72d7..0eecd4a4aa 100755 --- a/tools/fmt-bindings +++ b/tools/fmt-bindings @@ -18,7 +18,7 @@ $group_number = 0; %merge_bindings; $platform = linux; -$winkey = 'Mod4>