summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-12-12 02:22:12 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-12-12 02:22:12 +0000
commit6e337459a930e230991db0eea183ebfe76775368 (patch)
tree401202d5ab03bfc7dfa504964db2da45653502e8
parent740c5aebab39ca88503a1733880af7a337b05e83 (diff)
add a new Tweak to ArdourButton that makes ImplicitActive state use a solid color (the "led active" color), and adjst rec-enable buttons to use pink (like ardour2) when in this state (which means rec-enabled but not recording). and yes, this means that you can't use ImplicitUsesSolidColor with a button that also uses an LED - acceptable limitation
git-svn-id: svn://localhost/ardour2/branches/3.0@13645 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/ardour3_ui_default.conf4
-rw-r--r--gtk2_ardour/ardour_button.cc43
-rw-r--r--gtk2_ardour/ardour_button.h1
-rw-r--r--gtk2_ardour/route_ui.cc1
4 files changed, 30 insertions, 19 deletions
diff --git a/gtk2_ardour/ardour3_ui_default.conf b/gtk2_ardour/ardour3_ui_default.conf
index 4a4518104d..1329e3bb59 100644
--- a/gtk2_ardour/ardour3_ui_default.conf
+++ b/gtk2_ardour/ardour3_ui_default.conf
@@ -327,9 +327,9 @@
<Option name="record enable button: fill start active" value="280b0bff"/>
<Option name="record enable button: fill end active" value="b50e0eff"/>
<Option name="record enable button: led" value="00000000"/>
- <Option name="record enable button: led active" value="00000000"/>
+ <Option name="record enable button: led active" value="fda0b1ff"/>
<Option name="record enable button: text" value="a5a5a5ff"/>
- <Option name="record enable button: text active" value="d8d8d8ff"/>
+ <Option name="record enable button: text active" value="000000ff"/>
<Option name="send alert button: fill start" value="4e5647ff"/>
<Option name="send alert button: fill end" value="43493cff"/>
<Option name="send alert button: fill start active" value="91f928ff"/>
diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc
index c3d67a8462..796db0e1eb 100644
--- a/gtk2_ardour/ardour_button.cc
+++ b/gtk2_ardour/ardour_button.cc
@@ -201,17 +201,26 @@ ArdourButton::render (cairo_t* cr)
}
if (active_state() == Gtkmm2ext::ImplicitActive) {
- //background color
- cairo_set_source (cr, fill_pattern);
- cairo_fill (cr);
-
- //border
- UINT_TO_RGBA (fill_color_active, &r, &g, &b, &a);
- cairo_set_line_width (cr, 1.0);
- rounded_function (cr, 2, 2, get_width()-4, get_height()-4, _corner_radius - 1.5);
- cairo_set_source_rgba (cr, r/255.0, g/255.0, b/255.0, a/255.0);
- cairo_stroke (cr);
+ if (_tweaks & ImplicitUsesSolidColor) {
+ // note: with this tweak, implicit-active
+ // background color uses "led active" color
+ UINT_TO_RGBA (fill_color_active, &r, &g, &b, &a);
+ cairo_set_source_rgba (cr, r/255.0, g/255.0, b/255.0, a/255.0);
+ cairo_fill (cr);
+ } else {
+ //background color
+ cairo_set_source (cr, fill_pattern);
+ cairo_fill (cr);
+
+ //border
+ UINT_TO_RGBA (fill_color_active, &r, &g, &b, &a);
+ cairo_set_line_width (cr, 1.0);
+ rounded_function (cr, 2, 2, get_width()-4, get_height()-4, _corner_radius - 1.5);
+ cairo_set_source_rgba (cr, r/255.0, g/255.0, b/255.0, a/255.0);
+ cairo_stroke (cr);
+ }
+
} else if (active_state() == Gtkmm2ext::ExplicitActive || ((_elements & Indicator)==Indicator) ) {
//background color
@@ -431,11 +440,11 @@ ArdourButton::set_colors ()
uint32_t text_color;
uint32_t led_color;
- /* we use the edge of the button to show Selected state, so the
- * color/pattern used there will vary depending on that
- */
-
- fill_color_active = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill end active", get_name()));
+ if (_tweaks & ImplicitUsesSolidColor) {
+ fill_color_active = ARDOUR_UI::config()->color_by_name (string_compose ("%1: led active", get_name()));
+ } else {
+ fill_color_active = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill end active", get_name()));
+ }
fill_color_inactive = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill end", get_name()));
border_color = ARDOUR_UI::config()->color_by_name ( "button border" );
@@ -457,7 +466,7 @@ ArdourButton::set_colors ()
if (_elements & Body) {
start_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill start active", get_name()));
-
+
if (_flat_buttons) {
end_color = start_color;
} else {
@@ -521,7 +530,7 @@ ArdourButton::set_colors ()
/* text and LED colors */
- if (active_state() == Gtkmm2ext::ExplicitActive) {
+ if (active_state() == Gtkmm2ext::ExplicitActive || ((_tweaks & ImplicitUsesSolidColor) && active_state() == Gtkmm2ext::ImplicitActive)) {
text_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: text active", get_name()));
led_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: led active", get_name()));
} else {
diff --git a/gtk2_ardour/ardour_button.h b/gtk2_ardour/ardour_button.h
index e148d1a783..df5b115cb0 100644
--- a/gtk2_ardour/ardour_button.h
+++ b/gtk2_ardour/ardour_button.h
@@ -54,6 +54,7 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable
enum Tweaks {
ShowClick = 0x1,
NoModel = 0x2,
+ ImplicitUsesSolidColor = 0x4,
};
Tweaks tweaks() const { return _tweaks; }
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index 762d7a9b92..447f359187 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -120,6 +120,7 @@ RouteUI::init ()
rec_enable_button = manage (new ArdourButton);
rec_enable_button->set_name ("record enable button");
+ rec_enable_button->set_tweaks (ArdourButton::ImplicitUsesSolidColor);
UI::instance()->set_tip (rec_enable_button, _("Enable recording on this track"), "");
show_sends_button = manage (new ArdourButton);