From 0b60b2b5bce84f0eb1effad662b872f2fd75e3da Mon Sep 17 00:00:00 2001 From: miruka Date: Thu, 12 Sep 2019 17:32:48 -0400 Subject: [PATCH] Add autoplay GIF setting --- src/icons/thin/play.svg | 63 ++------------------------------------ src/python/config_files.py | 1 + src/qml/Base/HImage.qml | 6 ++-- 3 files changed, 7 insertions(+), 63 deletions(-) diff --git a/src/icons/thin/play.svg b/src/icons/thin/play.svg index 259a160f..b15abad6 100644 --- a/src/icons/thin/play.svg +++ b/src/icons/thin/play.svg @@ -1,61 +1,4 @@ - - - - - - image/svg+xml - - - - - - - - - + + + diff --git a/src/python/config_files.py b/src/python/config_files.py index 3a68ce66..5f76d6dd 100644 --- a/src/python/config_files.py +++ b/src/python/config_files.py @@ -106,6 +106,7 @@ class UISettings(JSONConfigFile): async def default_data(self) -> JsonData: return { "alertOnMessageForMsec": 4000, + "autoPlayGIF": True, "clearRoomFilterOnEnter": True, "clearRoomFilterOnEscape": True, "theme": "Default.qpl", diff --git a/src/qml/Base/HImage.qml b/src/qml/Base/HImage.qml index d0ce307d..8c4155fd 100644 --- a/src/qml/Base/HImage.qml +++ b/src/qml/Base/HImage.qml @@ -38,22 +38,22 @@ Image { property var pr: frameCount onPrChanged: print(source, pr) - property bool userPaused: false + property bool userPaused: ! window.settings.autoPlayGIF TapHandler { onTapped: parent.userPaused = ! parent.userPaused } HIcon { + anchors.centerIn: parent svgName: "play" colorize: "transparent" - anchors.centerIn: parent dimension: Math.min( parent.width - theme.spacing * 2, parent.height - theme.spacing * 2, theme.controls.image.maxPauseIndicatorSize, ) - scale: parent.paused ? 1 : 0 + scale: parent.status == Image.Ready && parent.paused ? 1 : 0 visible: scale > 0 Behavior on scale { HNumberAnimation { overshoot: 4 } }