diff --git a/src/images/dark/picture.svg b/src/images/dark/picture.svg new file mode 100644 index 0000000..79ac38e --- /dev/null +++ b/src/images/dark/picture.svg @@ -0,0 +1,115 @@ + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/images/light/picture.svg b/src/images/light/picture.svg new file mode 100644 index 0000000..0c73633 --- /dev/null +++ b/src/images/light/picture.svg @@ -0,0 +1,131 @@ + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/qml/Wallpaper/BackgroundPage.qml b/src/qml/Wallpaper/BackgroundPage.qml index 4ecf87c..52ce15c 100644 --- a/src/qml/Wallpaper/BackgroundPage.qml +++ b/src/qml/Wallpaper/BackgroundPage.qml @@ -99,6 +99,17 @@ ItemPage { } } + // Preload image + Image { + anchors.centerIn: parent + width: 64 + height: width + sourceSize: Qt.size(width, height) + source: FishUI.Theme.darkMode ? "qrc:/images/dark/picture.svg" + : "qrc:/images/light/picture.svg" + visible: _image.status !== Image.Ready + } + Rectangle { anchors.fill: parent anchors.margins: FishUI.Units.smallSpacing @@ -106,10 +117,10 @@ ItemPage { radius: FishUI.Theme.bigRadius + FishUI.Units.smallSpacing / 2 border.color: FishUI.Theme.highlightColor - border.width: image.status == Image.Ready & isSelected ? 3 : 0 + border.width: _image.status == Image.Ready & isSelected ? 3 : 0 Image { - id: image + id: _image anchors.fill: parent anchors.margins: FishUI.Units.smallSpacing source: "file://" + modelData @@ -131,8 +142,8 @@ ItemPage { layer.enabled: true layer.effect: OpacityMask { maskSource: Item { - width: image.width - height: image.height + width: _image.width + height: _image.height Rectangle { anchors.fill: parent @@ -152,10 +163,10 @@ ItemPage { } onEntered: function() { - image.opacity = 0.7 + _image.opacity = 0.7 } onExited: function() { - image.opacity = 1.0 + _image.opacity = 1.0 } onPressedChanged: item.scale = pressed ? 0.97 : 1.0 diff --git a/src/resources.qrc b/src/resources.qrc index 85e12bf..8f7dc20 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -90,5 +90,7 @@ images/powersave.svg images/performance.svg qml/Power/main.qml + images/light/picture.svg + images/dark/picture.svg