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)
This commit is contained in:
Robin Gareus 2014-08-29 20:20:37 +02:00
parent d6454dfb36
commit 083620beb8

View 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);