mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
WallpaperPanel: give focus to the gridview when clicking in it, so we can use keyboard
This commit is contained in:
@@ -572,6 +572,18 @@ SmartPanel {
|
||||
|
||||
model: filteredWallpapers
|
||||
|
||||
// Capture clicks on empty areas to give focus to GridView
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
z: -1
|
||||
onClicked: {
|
||||
wallpaperGridView.forceActiveFocus()
|
||||
if (wallpaperGridView.currentIndex < 0 && filteredWallpapers.length > 0) {
|
||||
wallpaperGridView.currentIndex = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property int columns: (screen.width > 1920) ? 5 : 4
|
||||
property int itemSize: cellWidth
|
||||
|
||||
@@ -739,6 +751,7 @@ SmartPanel {
|
||||
|
||||
TapHandler {
|
||||
onTapped: {
|
||||
wallpaperGridView.forceActiveFocus()
|
||||
wallpaperGridView.currentIndex = index
|
||||
if (Settings.data.wallpaper.setWallpaperOnAllMonitors) {
|
||||
WallpaperService.changeWallpaper(wallpaperPath, undefined)
|
||||
|
||||
Reference in New Issue
Block a user