summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_button.cc
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.cc
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.cc')
-rw-r--r--gtk2_ardour/ardour_button.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc
index ca0a1c38c0..778be28f20 100644
--- a/gtk2_ardour/ardour_button.cc
+++ b/gtk2_ardour/ardour_button.cc
@@ -53,7 +53,6 @@ ArdourButton::Element ArdourButton::just_led_default_elements = ArdourButton::El
ArdourButton::ArdourButton (Element e)
: _elements (e)
, _tweaks (Tweaks (0))
- , _act_on_release (true)
, _text_width (0)
, _text_height (0)
, _diameter (11.0)
@@ -62,10 +61,11 @@ ArdourButton::ArdourButton (Element e)
, fill_pattern (0)
, led_inset_pattern (0)
, reflection_pattern (0)
+ , _led_rect (0)
+ , _act_on_release (true)
, _led_left (false)
, _fixed_diameter (true)
, _distinct_led_click (false)
- , _led_rect (0)
, _hovering (false)
{
ColorsChanged.connect (sigc::mem_fun (*this, &ArdourButton::color_handler));
@@ -73,7 +73,6 @@ ArdourButton::ArdourButton (Element e)
ArdourButton::ArdourButton (const std::string& str, Element e)
: _elements (e)
- , _act_on_release (true)
, _text_width (0)
, _text_height (0)
, _diameter (11.0)
@@ -82,10 +81,11 @@ ArdourButton::ArdourButton (const std::string& str, Element e)
, fill_pattern (0)
, led_inset_pattern (0)
, reflection_pattern (0)
+ , _led_rect (0)
+ , _act_on_release (true)
, _led_left (false)
, _fixed_diameter (true)
, _distinct_led_click (false)
- , _led_rect (0)
, _hovering (false)
{
set_text (str);
@@ -535,14 +535,11 @@ ArdourButton::controllable_changed ()
void
ArdourButton::set_related_action (RefPtr<Action> act)
{
- _action = act;
+ Gtkmm2ext::Activatable::set_related_action (act);
if (_action) {
- string str = _action->property_tooltip().get_value();
- if (!str.empty()) {
- ARDOUR_UI::instance()->set_tip (*this, str);
- }
+ action_tooltip_changed ();
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (_action);
if (tact) {
@@ -698,4 +695,3 @@ ArdourButton::action_tooltip_changed ()
string str = _action->property_tooltip().get_value();
ARDOUR_UI::instance()->set_tip (*this, str);
}
-