change up wallpapper picker

This commit is contained in:
lucy 2026-08-16 02:14:44 +02:00
commit 1686141966
2 changed files with 28 additions and 33 deletions

View file

@ -9,8 +9,8 @@ Singleton {
// --- The Backgrounds (Darkest to Lightest) --- // --- The Backgrounds (Darkest to Lightest) ---
readonly property color accent: base0D readonly property color accent: base0D
readonly property color barBg: base01 readonly property color barBg: base00
readonly property color moduleBg: Qt.hsla(base01.hslHue, base01.hslSaturation, base01.hslLightness + 0.05, 1.0) readonly property color moduleBg: Qt.hsla(barBg.hslHue, barBg.hslSaturation, barBg.hslLightness + 0.05, 1.0)
readonly property color activeModuleBg: Qt.hsla(base01.hslHue, base01.hslSaturation, base01.hslLightness + 0.1, 1.0) readonly property color activeModuleBg: Qt.hsla(base01.hslHue, base01.hslSaturation, base01.hslLightness + 0.1, 1.0)
readonly property color text: base06 readonly property color text: base06
readonly property color base00: "#" + viewer.base00 readonly property color base00: "#" + viewer.base00

View file

@ -71,17 +71,15 @@ Rectangle {
if (wallPicker.visible) if (wallPicker.visible)
container.forceActiveFocus(); container.forceActiveFocus();
} }
ClippingRectangle { Rectangle {
id: container id: container
focus: true focus: true
Keys.onEscapePressed: { Keys.onEscapePressed: {
wallPicker.visible = false; wallPicker.visible = false;
} }
anchors.fill: parent anchors.fill: parent
color: Colors.base01 color: Colors.base00
radius: Config.rounding radius: Config.rounding
border.width: 2
border.color: Colors.base0D
GridView { GridView {
id: wallpaperLayout id: wallpaperLayout
clip: true clip: true
@ -90,37 +88,34 @@ Rectangle {
cellHeight: container.height cellHeight: container.height
cellWidth: container.width / 8 cellWidth: container.width / 8
anchors.fill: parent anchors.fill: parent
anchors.rightMargin: 10 anchors.centerIn: parent
anchors.margins: 10
model: wallpaperList model: wallpaperList
delegate: ClippingWrapperRectangle { delegate: ClippingRectangle {
id: wallTile id: wallTile
margin: 10 clip: true
required property var modelData required property var modelData
radius: Config.rounding / 1.5
color: 'transparent' color: 'transparent'
implicitWidth: wallPicker.width / 8 implicitWidth: wallpaperLayout.cellWidth - 20
implicitHeight: wallPicker.height implicitHeight: wallpaperLayout.cellHeight - 20
child: ClippingRectangle { Image {
id: wpRounder id: wallpaper
color: 'transparent' anchors.fill: parent
radius: Config.rounding / 1.5 source: wallTile.modelData.filePath
Image { sourceSize.width: 16 * 30
id: wallpaper sourceSize.height: 9 * 30
anchors.fill: parent asynchronous: true
source: wallTile.modelData.filePath cache: true
sourceSize.width: 16 * 30 }
sourceSize.height: 9 * 30 MouseArea {
asynchronous: true id: wpClickHandler
cache: true anchors.fill: parent
} cursorShape: Qt.PointingHandCursor
MouseArea { acceptedButtons: Qt.LeftButton
id: wpClickHandler hoverEnabled: true
anchors.fill: parent onClicked: {
cursorShape: Qt.PointingHandCursor Config.wallpaper = wallTile.modelData.filePath;
acceptedButtons: Qt.LeftButton
hoverEnabled: true
onClicked: {
Config.wallpaper = wallTile.modelData.filePath;
}
} }
} }
} }