summaryrefslogtreecommitdiff
path: root/gtk2_ardour/time_axis_view_item.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-06-24 16:28:53 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-06-24 16:28:53 -0400
commita1f858d3b207739e0719c1fc28003f1d9dd3965d (patch)
tree23c9c35f6b95e116f11354b0c78841036dcdc6bb /gtk2_ardour/time_axis_view_item.cc
parent0ce393f05144762a20d72975d0254ebca0789973 (diff)
an awful lot of tweaks to drawing details
Diffstat (limited to 'gtk2_ardour/time_axis_view_item.cc')
-rw-r--r--gtk2_ardour/time_axis_view_item.cc58
1 files changed, 29 insertions, 29 deletions
diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc
index ebda7312d4..d8d3cee807 100644
--- a/gtk2_ardour/time_axis_view_item.cc
+++ b/gtk2_ardour/time_axis_view_item.cc
@@ -731,30 +731,15 @@ TimeAxisViewItem::set_colors()
set_trim_handle_colors();
}
-/**
- * Sets the frame color depending on whether this item is selected
- */
-void
-TimeAxisViewItem::set_frame_color()
+uint32_t
+TimeAxisViewItem::get_fill_color () const
{
uint32_t f = 0;
- if (!frame) {
- return;
- }
-
if (_selected) {
f = ARDOUR_UI::config()->get_canvasvar_SelectedFrameBase();
- if (fill_opacity) {
- f = UINT_RGBA_CHANGE_A (f, fill_opacity);
- }
-
- if (!rect_visible) {
- f = UINT_RGBA_CHANGE_A (f, 0);
- }
-
} else {
if (_recregion) {
@@ -766,15 +751,32 @@ TimeAxisViewItem::set_frame_color()
} else {
f = fill_color;
}
+ }
+ }
- if (fill_opacity) {
- f = UINT_RGBA_CHANGE_A (f, fill_opacity);
- }
+ return f;
+}
- if (!rect_visible) {
- f = UINT_RGBA_CHANGE_A (f, 0);
- }
- }
+/**
+ * Sets the frame color depending on whether this item is selected
+ */
+void
+TimeAxisViewItem::set_frame_color()
+{
+ uint32_t f = 0;
+
+ if (!frame) {
+ return;
+ }
+
+ f = get_fill_color ();
+
+ if (fill_opacity) {
+ f = UINT_RGBA_CHANGE_A (f, fill_opacity);
+ }
+
+ if (!rect_visible) {
+ f = UINT_RGBA_CHANGE_A (f, 0);
}
frame->set_fill_color (f);
@@ -806,7 +808,7 @@ TimeAxisViewItem::set_frame_gradient ()
ArdourCanvas::Fill::StopList stops;
double r, g, b, a;
double h, s, v;
- ArdourCanvas::Color f (frame->fill_color());
+ ArdourCanvas::Color f (get_fill_color());
/* need to get alpha value */
ArdourCanvas::color_to_rgba (f, r, g, b, a);
@@ -816,10 +818,8 @@ TimeAxisViewItem::set_frame_gradient ()
/* now a darker version */
ArdourCanvas::color_to_hsv (f, h, s, v);
- s *= ARDOUR_UI::config()->get_timeline_item_gradient_depth();
- if (s > 1.0) {
- s = 1.0;
- }
+
+ v = min (1.0, v * (1.0 - ARDOUR_UI::config()->get_timeline_item_gradient_depth()));
ArdourCanvas::Color darker = ArdourCanvas::hsv_to_color (h, s, v, a);
stops.push_back (std::make_pair (1.0, darker));