summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-07-06 19:55:49 +0200
committerRobin Gareus <robin@gareus.org>2014-07-06 19:56:53 +0200
commit381b6848fc23ae49fabb23cf6b1e0f641034ee84 (patch)
treef10b5875cd05f0b2076844bc76a8ce72c7497aa2
parent881703144ce5e85e212a8ff617d3223fb559c67d (diff)
repair ardour-button "fixed color mode"
-rw-r--r--gtk2_ardour/ardour_button.cc10
-rw-r--r--gtk2_ardour/ardour_button.h1
2 files changed, 8 insertions, 3 deletions
diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc
index b01d093825..2525d57c07 100644
--- a/gtk2_ardour/ardour_button.cc
+++ b/gtk2_ardour/ardour_button.cc
@@ -87,6 +87,7 @@ ArdourButton::ArdourButton (Element e)
, _distinct_led_click (false)
, _hovering (false)
, _focused (false)
+ , _fixed_colors_set (false)
{
ARDOUR_UI_UTILS::ColorsChanged.connect (sigc::mem_fun (*this, &ArdourButton::color_handler));
}
@@ -124,6 +125,7 @@ ArdourButton::ArdourButton (const std::string& str, Element e)
, _distinct_led_click (false)
, _hovering (false)
, _focused (false)
+ , _fixed_colors_set (false)
{
set_text (str);
}
@@ -532,6 +534,9 @@ ArdourButton::on_size_request (Gtk::Requisition* req)
void
ArdourButton::set_colors ()
{
+ if (_fixed_colors_set) {
+ return;
+ }
std::string name = get_name();
border_color = ARDOUR_UI::config()->color_by_name ("button border");
@@ -555,9 +560,7 @@ ArdourButton::set_colors ()
*/
void ArdourButton::set_fixed_colors (const uint32_t color_active, const uint32_t color_inactive)
{
- set_name (""); /* this will trigger a "style-changed" message and then
- set_colors()
- */
+ _fixed_colors_set = true;
fill_start_active_color = fill_end_active_color = color_active;
@@ -582,6 +585,7 @@ void ArdourButton::set_fixed_colors (const uint32_t color_active, const uint32_t
/* XXX what about led colors ? */
build_patterns ();
+ set_name (""); /* this will trigger a "style-changed" message and then set_colors() */
}
void
diff --git a/gtk2_ardour/ardour_button.h b/gtk2_ardour/ardour_button.h
index dd6337dcef..7b8d2a2372 100644
--- a/gtk2_ardour/ardour_button.h
+++ b/gtk2_ardour/ardour_button.h
@@ -172,6 +172,7 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable
bool _distinct_led_click;
bool _hovering;
bool _focused;
+ bool _fixed_colors_set;
static bool _flat_buttons;