X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Fwx%2Ftimeline.cc;h=80f4133c03fdc9df6f567dc02c4eb1b73b29c1df;hp=f6ede297db3a809408c1a2f7dad9b68437760ed8;hb=ef25237193100de106eccdb8f40524fa670bda76;hpb=d8a8f4565b167aa23826999448601c8907728e8f diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index f6ede297d..80f4133c0 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -67,7 +67,7 @@ double const Timeline::_minimum_pixels_per_second = 640.0 / (60 * 60 * 3); int const Timeline::_minimum_pixels_per_track = 16; -Timeline::Timeline (wxWindow* parent, ContentPanel* cp, shared_ptr film, weak_ptr viewer) +Timeline::Timeline(wxWindow* parent, ContentPanel* cp, shared_ptr film, FilmViewer& viewer) : wxPanel (parent, wxID_ANY) , _labels_canvas (new wxScrolledCanvas (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE)) , _main_canvas (new wxScrolledCanvas (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE)) @@ -207,7 +207,7 @@ Timeline::paint_main () if (_zoom_point) { /* Translate back as _down_point and _zoom_point do not take scroll into account */ gc->Translate (vsx * _x_scroll_rate, vsy * _y_scroll_rate); - gc->SetPen (*wxBLACK_PEN); + gc->SetPen(gui_is_dark() ? *wxWHITE_PEN : *wxBLACK_PEN); gc->SetBrush (*wxTRANSPARENT_BRUSH); gc->DrawRectangle ( min (_down_point.x, _zoom_point->x), @@ -219,12 +219,9 @@ Timeline::paint_main () /* Playhead */ - auto vp = _viewer.lock (); - DCPOMATIC_ASSERT (vp); - gc->SetPen (*wxRED_PEN); auto path = gc->CreatePath (); - double const ph = vp->position().seconds() * pixels_per_second().get_value_or(0); + double const ph = _viewer.position().seconds() * pixels_per_second().get_value_or(0); path.MoveToPoint (ph, 0); path.AddLineToPoint (ph, pixels_per_track() * _tracks + 32); gc->StrokePath (path); @@ -479,7 +476,6 @@ Timeline::event_to_view (wxMouseEvent& ev) Position const p (ev.GetX() + vsx * _x_scroll_rate, ev.GetY() + vsy * _y_scroll_rate); while (i != _views.rend() && !(*i)->bbox().contains (p)) { - auto cv = dynamic_pointer_cast(*i); ++i; }