Fix seek during slider drag.
authorCarl Hetherington <cth@carlh.net>
Wed, 26 Jul 2017 16:07:36 +0000 (17:07 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 26 Jul 2017 16:07:36 +0000 (17:07 +0100)
src/wx/film_viewer.cc
src/wx/film_viewer.h

index a326cfa0b2dbb0fa36cce25213277672e6ac0601..4c3cc386c606e4dc45c70fac850d40ba890eaeeb 100644 (file)
@@ -135,7 +135,10 @@ FilmViewer::FilmViewer (wxWindow* p)
        _outline_content->Bind  (wxEVT_CHECKBOX,          boost::bind (&FilmViewer::refresh_panel,   this));
        _left_eye->Bind         (wxEVT_RADIOBUTTON,       boost::bind (&FilmViewer::refresh,         this));
        _right_eye->Bind        (wxEVT_RADIOBUTTON,       boost::bind (&FilmViewer::refresh,         this));
-       _slider->Bind           (wxEVT_SCROLL_CHANGED,    boost::bind (&FilmViewer::slider_moved,    this));
+       _slider->Bind           (wxEVT_SCROLL_THUMBTRACK, boost::bind (&FilmViewer::slider_moved,    this, false));
+       _slider->Bind           (wxEVT_SCROLL_PAGEUP,     boost::bind (&FilmViewer::slider_moved,    this, false));
+       _slider->Bind           (wxEVT_SCROLL_PAGEDOWN,   boost::bind (&FilmViewer::slider_moved,    this, false));
+       _slider->Bind           (wxEVT_SCROLL_CHANGED,    boost::bind (&FilmViewer::slider_moved,    this, true));
        _play_button->Bind      (wxEVT_TOGGLEBUTTON,      boost::bind (&FilmViewer::play_clicked,    this));
        _timer.Bind             (wxEVT_TIMER,             boost::bind (&FilmViewer::timer,           this));
        _back_button->Bind      (wxEVT_LEFT_DOWN,         boost::bind (&FilmViewer::back_clicked,    this, _1));
@@ -369,7 +372,7 @@ FilmViewer::paint_panel ()
 }
 
 void
-FilmViewer::slider_moved ()
+FilmViewer::slider_moved (bool update_slider)
 {
        if (!_film) {
                return;
@@ -382,7 +385,9 @@ FilmViewer::slider_moved ()
        }
        seek (t, false);
        update_position_label ();
-       update_position_slider ();
+       if (update_slider) {
+               update_position_slider ();
+       }
 }
 
 void
index aacede06e5bf64ff43629d8be01fb82951fff273..4a704ae6c26c217d5aa035c94596bdb9fc355833 100644 (file)
@@ -63,7 +63,7 @@ public:
 private:
        void paint_panel ();
        void panel_sized (wxSizeEvent &);
-       void slider_moved ();
+       void slider_moved (bool update_slider);
        void play_clicked ();
        void timer ();
        void calculate_sizes ();