Wallpaper: made the selection more responsive to clicks + code cleanup
This commit is contained in:
parent
3c7d03ada9
commit
125a3ace08
5 changed files with 78 additions and 65 deletions
|
|
@ -8,6 +8,7 @@ import qs.Widgets
|
|||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
width: parent.width
|
||||
|
||||
spacing: Style.marginL * scaling
|
||||
|
||||
|
|
@ -94,12 +95,10 @@ ColumnLayout {
|
|||
GridView {
|
||||
id: wallpaperGridView
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
model: wallpapersList
|
||||
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
flickableDirection: Flickable.VerticalFlick
|
||||
interactive: false
|
||||
clip: true
|
||||
|
||||
property int columns: 5
|
||||
property int itemSize: Math.floor((width - leftMargin - rightMargin - (4 * Style.marginS * scaling)) / columns)
|
||||
|
|
@ -180,7 +179,8 @@ ColumnLayout {
|
|||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
// Use on pressed instead of clicked to better register clicks
|
||||
onPressed: {
|
||||
if (Settings.data.wallpaper.setWallpaperOnAllMonitors) {
|
||||
WallpaperService.changeWallpaper(undefined, wallpaperPath)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue