summaryrefslogtreecommitdiff
path: root/gtk2_ardour/time_axis_view_item.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-02-08 20:01:55 +0000
committerCarl Hetherington <carl@carlh.net>2011-02-08 20:01:55 +0000
commitb7ec5b4b4014afc44d24876899d3741dfa45345e (patch)
treeebb45133333ebb44087171397a7a350b151aed30 /gtk2_ardour/time_axis_view_item.cc
parentce9035388b804a854c02ac60cc9c5e33e35ab28c (diff)
Option to colour region background using the track colour (#3759).
git-svn-id: svn://localhost/ardour2/branches/3.0@8778 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/time_axis_view_item.cc')
-rw-r--r--gtk2_ardour/time_axis_view_item.cc31
1 files changed, 21 insertions, 10 deletions
diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc
index 8220536508..fc0b4b24a1 100644
--- a/gtk2_ardour/time_axis_view_item.cc
+++ b/gtk2_ardour/time_axis_view_item.cc
@@ -23,7 +23,8 @@
#include "ardour/types.h"
#include "ardour/ardour.h"
-#include <gtkmm2ext/utils.h>
+#include "gtkmm2ext/utils.h"
+#include "gtkmm2ext/gui_thread.h"
#include "ardour_ui.h"
/*
@@ -224,6 +225,8 @@ TimeAxisViewItem::init (
set_duration (item_duration, this);
set_position (start, this);
+
+ Config->ParameterChanged.connect (*this, invalidator (*this), ui_bind (&TimeAxisViewItem::parameter_changed, this, _1), gui_context ());
}
TimeAxisViewItem::~TimeAxisViewItem()
@@ -692,19 +695,20 @@ TimeAxisViewItem::set_frame_color()
} else {
if (_recregion) {
frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
- } else if (high_enough_for_name) {
- if (fill_opacity) {
- frame->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_FrameBase.get(), fill_opacity);
+ } else {
+ uint32_t f = 0;
+ if (high_enough_for_name && !Config->get_color_regions_using_track_color()) {
+ f = ARDOUR_UI::config()->canvasvar_FrameBase.get();
} else {
- frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameBase.get();
+ f = fill_color;
}
- } else {
+
if (fill_opacity) {
- frame->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fill_color, fill_opacity);
- } else {
- frame->property_fill_color_rgba() = fill_color;
+ f = UINT_RGBA_CHANGE_A (f, fill_opacity);
}
- }
+
+ frame->property_fill_color_rgba() = f;
+ }
}
}
@@ -900,3 +904,10 @@ TimeAxisViewItem::update_name_pixbuf_visibility ()
}
}
+void
+TimeAxisViewItem::parameter_changed (string p)
+{
+ if (p == "color-regions-using-track-color") {
+ set_frame_color ();
+ }
+}