13
0

tweak logic for region coloring, particularly when muted

This commit is contained in:
Paul Davis 2014-06-05 14:07:26 -04:00
parent 748c137461
commit 05f476875b
3 changed files with 46 additions and 35 deletions

View File

@ -1428,6 +1428,13 @@ AudioRegionView::set_one_waveform_color (ArdourCanvas::WaveView* wave)
} else { } else {
outline = ARDOUR_UI::config()->get_canvasvar_SelectedWaveForm(); outline = ARDOUR_UI::config()->get_canvasvar_SelectedWaveForm();
fill = ARDOUR_UI::config()->get_canvasvar_SelectedWaveFormFill(); fill = ARDOUR_UI::config()->get_canvasvar_SelectedWaveFormFill();
if (ARDOUR_UI::config()->get_color_regions_using_track_color()) {
/* just use a slightly transparent version of the selected
* color so that some of the track color bleeds through
*/
fill = UINT_RGBA_CHANGE_A (fill, 217);
}
} }
} else { } else {
if (_recregion) { if (_recregion) {
@ -1441,20 +1448,15 @@ AudioRegionView::set_one_waveform_color (ArdourCanvas::WaveView* wave)
} else { } else {
outline = ARDOUR_UI::config()->get_canvasvar_WaveForm(); outline = ARDOUR_UI::config()->get_canvasvar_WaveForm();
fill = ARDOUR_UI::config()->get_canvasvar_WaveFormFill(); fill = ARDOUR_UI::config()->get_canvasvar_WaveFormFill();
}
}
}
if (ARDOUR_UI::config()->get_color_regions_using_track_color()) { if (ARDOUR_UI::config()->get_color_regions_using_track_color()) {
/* just use a slightly transparent version of the selected /* just use a slightly transparent version of the selected
* color so that some of the track color bleeds through * color so that some of the track color bleeds through
*/ */
fill = UINT_RGBA_CHANGE_A (fill, 217);
double r, g, b, a; }
ArdourCanvas::color_to_rgba (fill, r, g, b, a); }
fill = ArdourCanvas::rgba_to_color (r, g, b, 0.85); /* magic number, not user controllable */ }
outline = ARDOUR_UI::config()->get_canvasvar_WaveForm();
} }
wave->set_fill_color (fill); wave->set_fill_color (fill);
@ -1470,13 +1472,7 @@ AudioRegionView::set_frame_color ()
return; return;
} }
if (_region->opaque()) { RegionView::set_frame_color ();
fill_opacity = 130;
} else {
fill_opacity = 0;
}
TimeAxisViewItem::set_frame_color ();
set_waveform_colors (); set_waveform_colors ();
} }

View File

@ -535,6 +535,10 @@ RegionView::set_colors ()
void void
RegionView::set_frame_color () RegionView::set_frame_color ()
{ {
if (!frame) {
return;
}
if (_region->opaque()) { if (_region->opaque()) {
fill_opacity = 130; fill_opacity = 130;
} else { } else {

View File

@ -755,12 +755,23 @@ TimeAxisViewItem::set_name_text_color ()
uint32_t uint32_t
TimeAxisViewItem::get_fill_color () const TimeAxisViewItem::get_fill_color () const
{ {
uint32_t f = 0; uint32_t f;
uint32_t o;
if (_selected) { if (_selected) {
f = ARDOUR_UI::config()->get_canvasvar_SelectedFrameBase(); f = ARDOUR_UI::config()->get_canvasvar_SelectedFrameBase();
if (fill_opacity != 0) {
o = fill_opacity;
} else {
/* some condition of this item has set fill opacity to
* zero, but it has been selected, so use a mid-way
* alpha value to make it reasonably visible.
*/
o = 130;
}
} else { } else {
if (_recregion) { if (_recregion) {
@ -773,9 +784,18 @@ TimeAxisViewItem::get_fill_color () const
f = fill_color; f = fill_color;
} }
} }
/* tweak opacity */
if (!rect_visible) {
o = 0;
} else {
o = fill_opacity;
} }
return f; }
return UINT_RGBA_CHANGE_A (f, o);
} }
/** /**
@ -784,26 +804,16 @@ TimeAxisViewItem::get_fill_color () const
void void
TimeAxisViewItem::set_frame_color() TimeAxisViewItem::set_frame_color()
{ {
uint32_t f = 0;
if (!frame) { if (!frame) {
return; return;
} }
f = get_fill_color (); frame->set_fill_color (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);
set_frame_gradient (); set_frame_gradient ();
if (!_recregion) { if (!_recregion) {
uint32_t f;
if (_selected) { if (_selected) {
f = ARDOUR_UI::config()->get_canvasvar_SelectedTimeAxisFrame(); f = ARDOUR_UI::config()->get_canvasvar_SelectedTimeAxisFrame();
} else { } else {
@ -811,6 +821,7 @@ TimeAxisViewItem::set_frame_color()
} }
if (!rect_visible) { if (!rect_visible) {
/* make the frame outline be visible but rather transparent */
f = UINT_RGBA_CHANGE_A (f, 64); f = UINT_RGBA_CHANGE_A (f, 64);
} }