From 0a71d52448f6144d5225269b378711bfba0bb37b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 24 Nov 2011 05:36:31 +0000 Subject: Fix key bindings in tooltips for ArdourButton buttons. Sinced gtkmm2ext needs to get at the actions of widgets, I moved the action to Gtkmm2ext::Activatable. Not sure if the wisest thing to do here would be to use Gtkmm::Activatable, but figured there's a reason Paul didn't do so (the name set_related_action is from there so presumably it's known about), so this is the simplest change that allows access to the action in Gtkmm2ext. The vfunc calling stuff should probably move there as well... git-svn-id: svn://localhost/ardour2/branches/3.0@10818 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour_button.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'gtk2_ardour/ardour_button.h') diff --git a/gtk2_ardour/ardour_button.h b/gtk2_ardour/ardour_button.h index fb0f8320a1..695d31e419 100644 --- a/gtk2_ardour/ardour_button.h +++ b/gtk2_ardour/ardour_button.h @@ -27,10 +27,11 @@ #include "pbd/signals.h" #include "gtkmm2ext/binding_proxy.h" +#include "gtkmm2ext/activatable.h" #include "cairo_widget.h" -class ArdourButton : public CairoWidget +class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable { public: enum Element { @@ -76,7 +77,7 @@ class ArdourButton : public CairoWidget boost::shared_ptr get_controllable() { return binding_proxy.get_controllable(); } void set_controllable (boost::shared_ptr c); - void watch (); + void watch (); void set_related_action (Glib::RefPtr); @@ -93,8 +94,8 @@ class ArdourButton : public CairoWidget bool on_enter_notify_event (GdkEventCrossing*); bool on_leave_notify_event (GdkEventCrossing*); - void controllable_changed (); - PBD::ScopedConnection watch_connection; + void controllable_changed (); + PBD::ScopedConnection watch_connection; private: Glib::RefPtr _layout; @@ -102,8 +103,7 @@ class ArdourButton : public CairoWidget std::string _text; Element _elements; Tweaks _tweaks; - BindingProxy binding_proxy; - bool _act_on_release; + BindingProxy binding_proxy; int _text_width; int _text_height; @@ -115,6 +115,8 @@ class ArdourButton : public CairoWidget cairo_pattern_t* led_inset_pattern; cairo_pattern_t* reflection_pattern; + cairo_rectangle_t* _led_rect; + double text_r; double text_g; double text_b; @@ -125,18 +127,16 @@ class ArdourButton : public CairoWidget double led_b; double led_a; + bool _act_on_release; bool _led_left; bool _fixed_diameter; bool _distinct_led_click; - cairo_rectangle_t* _led_rect; bool _hovering; void setup_led_rect (); void set_colors (); void color_handler (); - Glib::RefPtr _action; - void action_activated (); void action_toggled (); void action_sensitivity_changed (); -- cgit v1.2.3