summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_button.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-08-29 20:20:37 +0200
committerRobin Gareus <robin@gareus.org>2014-08-29 20:20:37 +0200
commit083620beb898fc77fd231bbaccecfe9d6c104315 (patch)
treeaadc9165d6d6468fb70f8f061c2aa3f2e80bef71 /gtk2_ardour/ardour_button.cc
parentd6454dfb368296a8dc4fc172208e394add5a6b8d (diff)
ArdourButton: suppress visible response if no action is defined.
This fixes issues where the button is used as Label (currently track-numbers and meterbridge track-name)
Diffstat (limited to 'gtk2_ardour/ardour_button.cc')
-rw-r--r--gtk2_ardour/ardour_button.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc
index c30bf13ef2..fb07ecffe9 100644
--- a/gtk2_ardour/ardour_button.cc
+++ b/gtk2_ardour/ardour_button.cc
@@ -430,7 +430,7 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
}
//user is currently pressing the button. black outline helps to indicate this
- if ( _grabbed && !((_elements & Menu)==Menu) ) {
+ if ( _grabbed && !((_elements & Menu)==Menu) && _action) {
cairo_set_line_width(cr,1);
rounded_function (cr, 1, 1, get_width()-2, get_height()-2, _corner_radius - 1);
cairo_set_source_rgba (cr, 0, 0, 0, 1.0);
@@ -446,6 +446,10 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
}
//I guess this means we have keyboard focus. I don't think this works currently
+ //
+ //A: yes, it's keyboard focus and it does work when there's no editor window
+ // (the editor is always the first receiver for KeyDown).
+ // It's needed for eg. the engine-dialog at startup or after closing a sesion.
if (_focused) {
rounded_function (cr, 1.5, 1.5, get_width() - 3, get_height() - 3, _corner_radius);
cairo_set_source_rgba (cr, 0.905, 0.917, 0.925, 0.8);