[vlc-commits] [Git][videolan/vlc][master] 2 commits: qt: add mouseHideTimeout property to MainCtx

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sun Dec 8 14:14:21 UTC 2024



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
cba53bbf by Fatih Uzunoglu at 2024-12-08T13:52:14+00:00
qt: add mouseHideTimeout property to MainCtx

Its value is retrieved from `mouse-hide-timeout`.

- - - - -
432b0e89 by Fatih Uzunoglu at 2024-12-08T13:52:14+00:00
qml: use `mouseHideTimeout` in `PlayerToolbarVisibilityFSM.qml`

- - - - -


3 changed files:

- modules/gui/qt/maininterface/mainctx.cpp
- modules/gui/qt/maininterface/mainctx.hpp
- modules/gui/qt/player/qml/PlayerToolbarVisibilityFSM.qml


Changes:

=====================================
modules/gui/qt/maininterface/mainctx.cpp
=====================================
@@ -425,6 +425,8 @@ void MainCtx::loadPrefs(const bool callSignals)
     loadFromVLCOption(m_pinOpacity, "qt-fs-opacity", &MainCtx::pinOpacityChanged);
 
     loadFromVLCOption(m_safeArea, "qt-safe-area", &MainCtx::safeAreaChanged);
+
+    loadFromVLCOption(m_mouseHideTimeout, "mouse-hide-timeout", &MainCtx::mouseHideTimeoutChanged);
 }
 
 void MainCtx::loadFromSettingsImpl(const bool callSignals)


=====================================
modules/gui/qt/maininterface/mainctx.hpp
=====================================
@@ -128,6 +128,7 @@ class MainCtx : public QObject
     Q_PROPERTY(int maxVolume READ maxVolume NOTIFY maxVolumeChanged FINAL)
     Q_PROPERTY(float safeArea READ safeArea NOTIFY safeAreaChanged FINAL)
     Q_PROPERTY(VideoSurfaceProvider* videoSurfaceProvider READ getVideoSurfaceProvider WRITE setVideoSurfaceProvider NOTIFY hasEmbededVideoChanged FINAL)
+    Q_PROPERTY(int mouseHideTimeout READ mouseHideTimeout NOTIFY mouseHideTimeoutChanged FINAL)
 
     Q_PROPERTY(CSDButtonModel *csdButtonModel READ csdButtonModel CONSTANT FINAL)
 
@@ -255,6 +256,8 @@ public:
     VideoSurfaceProvider* getVideoSurfaceProvider() const;
     void setVideoSurfaceProvider(VideoSurfaceProvider* videoSurfaceProvider);
 
+    int mouseHideTimeout() const { return m_mouseHideTimeout; }
+
     Q_INVOKABLE static inline void setCursor(Qt::CursorShape cursor) { QApplication::setOverrideCursor(QCursor(cursor)); }
     Q_INVOKABLE static inline void restoreCursor(void) { QApplication::restoreOverrideCursor(); }
 
@@ -381,6 +384,8 @@ protected:
 
     float m_safeArea = 0.0;
 
+    int m_mouseHideTimeout = 1000;
+
     OsType m_osName;
     int m_osVersion;
 
@@ -490,6 +495,8 @@ signals:
 
     void safeAreaChanged();
 
+    void mouseHideTimeoutChanged();
+
     void navBoxToggled();
 
     void bgConeToggled();


=====================================
modules/gui/qt/player/qml/PlayerToolbarVisibilityFSM.qml
=====================================
@@ -59,7 +59,7 @@ FSM {
     property alias isVisible: fsmVisible.active
 
     property int lockCount: 0 // Track the number of locks
-    property int timeoutDuration: 3000
+    property int timeoutDuration: MainCtx.mouseHideTimeout
 
     initialState: ((Player.isInteractive && MainCtx.hasEmbededVideo))
                   ? fsmHidden : fsmVisible
@@ -130,14 +130,14 @@ FSM {
                     mouseMove: {
                         guard: () => !Player.isInteractive,
                         action: () => { 
-                            fsm.timeoutDuration = 3000;
+                            fsm.timeoutDuration = MainCtx.mouseHideTimeout;
                         },
                         target: fsmVideoMode
                     },
                     keyboardMove: {
                         guard: () => !Player.isInteractive,
                         action: () => { 
-                            fsm.timeoutDuration = 5000
+                            fsm.timeoutDuration = MainCtx.mouseHideTimeout * 2
                         },
                         target: fsmVideoMode
                     }
@@ -177,14 +177,14 @@ FSM {
             mouseMove: {
                 guard: () => !Player.isInteractive,
                 action: () => {
-                    fsm.timeoutDuration = 3000
+                    fsm.timeoutDuration = MainCtx.mouseHideTimeout
                 },
                 target: fsmVisible
             },
             keyboardMove: {
                 guard: () => !Player.isInteractive,
                 action: () => {
-                    fsm.timeoutDuration = 5000
+                    fsm.timeoutDuration = MainCtx.mouseHideTimeout * 2
                 },
                 target: fsmVisible
             },



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/62daad61bf8efd687bb1970a16c359733f0b73cf...432b0e89e0d7eeb80bc328878df8a54b71ece0d9

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/62daad61bf8efd687bb1970a16c359733f0b73cf...432b0e89e0d7eeb80bc328878df8a54b71ece0d9
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list