change up wallpapper picker
This commit is contained in:
parent
89e77044c2
commit
1686141966
2 changed files with 28 additions and 33 deletions
|
|
@ -71,17 +71,15 @@ Rectangle {
|
|||
if (wallPicker.visible)
|
||||
container.forceActiveFocus();
|
||||
}
|
||||
ClippingRectangle {
|
||||
Rectangle {
|
||||
id: container
|
||||
focus: true
|
||||
Keys.onEscapePressed: {
|
||||
wallPicker.visible = false;
|
||||
}
|
||||
anchors.fill: parent
|
||||
color: Colors.base01
|
||||
color: Colors.base00
|
||||
radius: Config.rounding
|
||||
border.width: 2
|
||||
border.color: Colors.base0D
|
||||
GridView {
|
||||
id: wallpaperLayout
|
||||
clip: true
|
||||
|
|
@ -90,37 +88,34 @@ Rectangle {
|
|||
cellHeight: container.height
|
||||
cellWidth: container.width / 8
|
||||
anchors.fill: parent
|
||||
anchors.rightMargin: 10
|
||||
anchors.centerIn: parent
|
||||
anchors.margins: 10
|
||||
model: wallpaperList
|
||||
delegate: ClippingWrapperRectangle {
|
||||
delegate: ClippingRectangle {
|
||||
id: wallTile
|
||||
margin: 10
|
||||
clip: true
|
||||
required property var modelData
|
||||
radius: Config.rounding / 1.5
|
||||
color: 'transparent'
|
||||
implicitWidth: wallPicker.width / 8
|
||||
implicitHeight: wallPicker.height
|
||||
child: ClippingRectangle {
|
||||
id: wpRounder
|
||||
color: 'transparent'
|
||||
radius: Config.rounding / 1.5
|
||||
Image {
|
||||
id: wallpaper
|
||||
anchors.fill: parent
|
||||
source: wallTile.modelData.filePath
|
||||
sourceSize.width: 16 * 30
|
||||
sourceSize.height: 9 * 30
|
||||
asynchronous: true
|
||||
cache: true
|
||||
}
|
||||
MouseArea {
|
||||
id: wpClickHandler
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
Config.wallpaper = wallTile.modelData.filePath;
|
||||
}
|
||||
implicitWidth: wallpaperLayout.cellWidth - 20
|
||||
implicitHeight: wallpaperLayout.cellHeight - 20
|
||||
Image {
|
||||
id: wallpaper
|
||||
anchors.fill: parent
|
||||
source: wallTile.modelData.filePath
|
||||
sourceSize.width: 16 * 30
|
||||
sourceSize.height: 9 * 30
|
||||
asynchronous: true
|
||||
cache: true
|
||||
}
|
||||
MouseArea {
|
||||
id: wpClickHandler
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
Config.wallpaper = wallTile.modelData.filePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue