diff --git a/modules/gui/qt/maininterface/mainctx.cpp b/modules/gui/qt/maininterface/mainctx.cpp index 89c4c78d01bd8058c99b36108b9f421a732055ff..74da25a65366ac3e3342a534ecfcc3fe256c2234 100644 --- a/modules/gui/qt/maininterface/mainctx.cpp +++ b/modules/gui/qt/maininterface/mainctx.cpp @@ -428,6 +428,8 @@ void MainCtx::loadPrefs(const bool callSignals) loadFromVLCOption(m_safeArea, "qt-safe-area", &MainCtx::safeAreaChanged); loadFromVLCOption(m_mouseHideTimeout, "mouse-hide-timeout", &MainCtx::mouseHideTimeoutChanged); + + loadFromVLCOption(m_animationScale, "qt-animation-scale", &MainCtx::animationScaleChanged); } void MainCtx::loadFromSettingsImpl(const bool callSignals) diff --git a/modules/gui/qt/maininterface/mainctx.hpp b/modules/gui/qt/maininterface/mainctx.hpp index 43c7d1fcf905bd0e6c2cccd696e677c222423d06..a4024a32c19f46da089cc1dba4584d3a710890bc 100644 --- a/modules/gui/qt/maininterface/mainctx.hpp +++ b/modules/gui/qt/maininterface/mainctx.hpp @@ -129,6 +129,7 @@ class MainCtx : public QObject 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(float animationScale READ animationScale NOTIFY animationScaleChanged FINAL) Q_PROPERTY(CSDButtonModel *csdButtonModel READ csdButtonModel CONSTANT FINAL) @@ -258,6 +259,8 @@ public: int mouseHideTimeout() const { return m_mouseHideTimeout; } + float animationScale() const { return m_animationScale; } + Q_INVOKABLE static inline bool useTopLevelWindowForToolTip() { assert(qGuiApp); if constexpr (QT_VERSION < QT_VERSION_CHECK(6, 8, 0)) @@ -442,6 +445,8 @@ protected: int m_mouseHideTimeout = 1000; + float m_animationScale = 1.0f; + OsType m_osName; int m_osVersion; @@ -556,6 +561,8 @@ signals: void mouseHideTimeoutChanged(); + void animationScaleChanged(); + void navBoxToggled(); void bgConeToggled(); diff --git a/modules/gui/qt/qt.cpp b/modules/gui/qt/qt.cpp index 57d25ed5dc147a9aa868e39a2bddd3fbb14eb931..823b421ee72853539bec31c9e6cee05ec75afa14 100644 --- a/modules/gui/qt/qt.cpp +++ b/modules/gui/qt/qt.cpp @@ -270,6 +270,10 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * ); #define PIP_MODE_TEXT N_( "Enable picture-in-picture (PiP) mode" ) #define PIP_MODE_LONGTEXT N_( "Picture-in-picture mode allows playing video contained in a smaller area so that the interface remains usable." ) +#define ANIMATION_SCALE_TEXT N_( "Animation scale" ) +#define ANIMATION_SCALE_LONGTEXT N_( "The factor used when determining the animation duration, when applicable. A factor of 0.0 " \ + "effectively disables the animations, but may cause issues in certain places." ) + static const int initial_prefs_view_list[] = { 0, 1, 2 }; static const char *const initial_prefs_view_list_texts[] = { N_("Simple"), N_("Advanced"), N_("Expert") }; @@ -448,6 +452,8 @@ vlc_module_begin () add_float_with_range( "qt-safe-area", 0, 0, 100.0, SAFE_AREA_TEXT, SAFE_AREA_LONGTEXT ) + add_float_with_range( "qt-animation-scale", 1.0f, 0.0f, 10.0f, ANIMATION_SCALE_TEXT, ANIMATION_SCALE_LONGTEXT ) + cannot_unload_broken_library() add_submodule () diff --git a/modules/gui/qt/style/VLCStyle.qml b/modules/gui/qt/style/VLCStyle.qml index 35beaa007b8d6648b2797452919cae997582979f..0aff8f46b776cac6b5632f0d70e75e6e01ad829b 100644 --- a/modules/gui/qt/style/VLCStyle.qml +++ b/modules/gui/qt/style/VLCStyle.qml @@ -266,16 +266,16 @@ QtObject { // durations. Values are aligned on Kirigami //should be used for animation that benefits from a longer animation than duration_long - readonly property int duration_veryLong: 400 + readonly property int duration_veryLong: 400 * MainCtx.animationScale //should be used for longer animation (opening/closing panes & dialogs) - readonly property int duration_long: 200 + readonly property int duration_long: 200 * MainCtx.animationScale //should be used for short animations (hovering, accuenting UI event) - readonly property int duration_short: 100 + readonly property int duration_short: 100 * MainCtx.animationScale //should be used for near instant animations - readonly property int duration_veryShort: 50 + readonly property int duration_veryShort: 50 * MainCtx.animationScale /* human time reaction, how much time before the user should be informed that something * is going on, or before something should be automatically automated, @@ -294,7 +294,7 @@ QtObject { readonly property int delayToolTipAppear: 700 //timing for the progressbar/scanbar bouncing animation, explicitly very long - readonly property int durationSliderBouncing: 2000 + readonly property int durationSliderBouncing: 2000 * MainCtx.animationScale //default arts readonly property url noArtAlbum: "qrc:///placeholder/noart_album.svg";