]> git.sesse.net Git - pkanalytics/blobdiff - video_widget.h
Support dragging the picture around when we are zoomed.
[pkanalytics] / video_widget.h
index 801d5cdb6844565e1c7de2853a06de28bc6e99ee..56cf92862605d41b82e56caf90f9d834c4ec64e7 100644 (file)
@@ -39,6 +39,11 @@ public:
        void paintGL() override;
        void wheelEvent(QWheelEvent *event) override;
 
+       // For dragging.
+       void mousePressEvent(QMouseEvent *e);
+       void mouseReleaseEvent(QMouseEvent *e);
+       void mouseMoveEvent(QMouseEvent *e);
+
 signals:
        void position_changed(uint64_t pos);
 
@@ -92,6 +97,9 @@ private:
 
        std::string pathname;
 
+       bool dragging = false;
+       float last_drag_x, last_drag_y;
+
        void producer_thread_func();
        bool play_video(const std::string &pathname);
        void internal_rewind();