ArdourButton: suppress visible response if no action is defined.
authorRobin Gareus <robin@gareus.org>
Fri, 29 Aug 2014 18:20:37 +0000 (20:20 +0200)
committerRobin Gareus <robin@gareus.org>
Fri, 29 Aug 2014 18:20:37 +0000 (20:20 +0200)
This fixes issues where the button is used as Label
(currently track-numbers and meterbridge track-name)

gtk2_ardour/ardour_button.cc

index c30bf13ef24ac1dde9a4c8a329fa3ba88dcedb2e..fb07ecffe9b0d1eca036042c92fe3b334b3bd75e 100644 (file)
@@ -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);