summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_button.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-11-24 05:36:31 +0000
committerDavid Robillard <d@drobilla.net>2011-11-24 05:36:31 +0000
commit0a71d52448f6144d5225269b378711bfba0bb37b (patch)
treed40c810164b7c6d85c80e006a08d9459564ed6fb /gtk2_ardour/ardour_button.h
parent0bd3105f50f3c82586e0924a4be9977425caaf90 (diff)
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
Diffstat (limited to 'gtk2_ardour/ardour_button.h')
-rw-r--r--gtk2_ardour/ardour_button.h18
1 files changed, 9 insertions, 9 deletions
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<PBD::Controllable> get_controllable() { return binding_proxy.get_controllable(); }
void set_controllable (boost::shared_ptr<PBD::Controllable> c);
- void watch ();
+ void watch ();
void set_related_action (Glib::RefPtr<Gtk::Action>);
@@ -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<Pango::Layout> _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<Gtk::Action> _action;
- void action_activated ();
void action_toggled ();
void action_sensitivity_changed ();