From 78b9f65632d725dd35436a4ad1bc26b9eeecc32e Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 29 Aug 2014 21:08:49 +0200 Subject: [PATCH] explicit Button inactive state. Ideally large parts of ArdourButton would become ArdourLabel, which in turn is used by ArdourButton --- gtk2_ardour/ardour_button.cc | 4 ++-- gtk2_ardour/ardour_button.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc index fb07ecffe9..f353edab43 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) && _action) { + if ( _grabbed && !(_elements & (Inactive|Menu))) { 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); @@ -911,7 +911,7 @@ ArdourButton::on_key_release_event (GdkEventKey *ev) { bool ArdourButton::on_enter_notify_event (GdkEventCrossing* ev) { - _hovering = true; + _hovering = (_elements & Inactive) ? false : true; if (ARDOUR::Config->get_widget_prelight()) { queue_draw (); diff --git a/gtk2_ardour/ardour_button.h b/gtk2_ardour/ardour_button.h index c6e38aff2e..75e3a9cd90 100644 --- a/gtk2_ardour/ardour_button.h +++ b/gtk2_ardour/ardour_button.h @@ -39,6 +39,7 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable Indicator = 0x8, unused = 0x10, Menu = 0x20, + Inactive = 0x40, // no _action is defined AND state is not used }; static Element default_elements;