13
0

explicit Button inactive state.

Ideally large parts of ArdourButton would become ArdourLabel,
which in turn is used by ArdourButton
This commit is contained in:
Robin Gareus 2014-08-29 21:08:49 +02:00
parent 083620beb8
commit 78b9f65632
2 changed files with 3 additions and 2 deletions

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 //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); cairo_set_line_width(cr,1);
rounded_function (cr, 1, 1, get_width()-2, get_height()-2, _corner_radius - 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); cairo_set_source_rgba (cr, 0, 0, 0, 1.0);
@ -911,7 +911,7 @@ ArdourButton::on_key_release_event (GdkEventKey *ev) {
bool bool
ArdourButton::on_enter_notify_event (GdkEventCrossing* ev) ArdourButton::on_enter_notify_event (GdkEventCrossing* ev)
{ {
_hovering = true; _hovering = (_elements & Inactive) ? false : true;
if (ARDOUR::Config->get_widget_prelight()) { if (ARDOUR::Config->get_widget_prelight()) {
queue_draw (); queue_draw ();

View File

@ -39,6 +39,7 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable
Indicator = 0x8, Indicator = 0x8,
unused = 0x10, unused = 0x10,
Menu = 0x20, Menu = 0x20,
Inactive = 0x40, // no _action is defined AND state is not used
}; };
static Element default_elements; static Element default_elements;