13
0

Summary View should use the playhead color from config.

This commit is contained in:
Ben Loftis 2019-02-12 11:30:31 -06:00
parent 3e442ae52b
commit c881b4a85f
2 changed files with 18 additions and 2 deletions

View File

@ -118,6 +118,10 @@ EditorSummary::set_session (Session* s)
_editor->selection->RegionsChanged.connect (sigc::mem_fun(*this, &EditorSummary::set_background_dirty)); _editor->selection->RegionsChanged.connect (sigc::mem_fun(*this, &EditorSummary::set_background_dirty));
} }
UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &EditorSummary::set_colors));
set_colors();
_leftmost = max_samplepos; _leftmost = max_samplepos;
_rightmost = 0; _rightmost = 0;
} }
@ -286,8 +290,9 @@ EditorSummary::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle
/* Playhead */ /* Playhead */
cairo_set_line_width (cr, 1); cairo_set_line_width (cr, 1);
/* XXX: colour should be set from configuration file */
cairo_set_source_rgba (cr, 1, 0, 0, 1); double r,g,b,a; Gtkmm2ext::color_to_rgba(_phead_color, r,g,b,a);
cairo_set_source_rgb (cr, r,g,b); // playhead color
const double ph= playhead_sample_to_position (_editor->playhead_cursor->current_sample()); const double ph= playhead_sample_to_position (_editor->playhead_cursor->current_sample());
cairo_move_to (cr, ph, 0); cairo_move_to (cr, ph, 0);
@ -299,6 +304,14 @@ EditorSummary::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle
} }
void
EditorSummary::set_colors ()
{
_phead_color = UIConfiguration::instance().color ("play head");
}
/** Render a region for the summary. /** Render a region for the summary.
* @param r Region view. * @param r Region view.
* @param cr Cairo context. * @param cr Cairo context.

View File

@ -105,6 +105,9 @@ private:
bool _move_dragging; bool _move_dragging;
void set_colors ();
uint32_t _phead_color;
//used for zooming //used for zooming
int _last_mx; int _last_mx;
int _last_my; int _last_my;