From 083620beb898fc77fd231bbaccecfe9d6c104315 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 29 Aug 2014 20:20:37 +0200 Subject: [PATCH] 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) --- gtk2_ardour/ardour_button.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- 2.30.2