homescreens/Halcyon: trigger children using signals instead of focus property

This commit is contained in:
Yari Polla 2023-03-13 11:44:56 +01:00
parent 4fc8582da5
commit c3882691bc
3 changed files with 16 additions and 15 deletions

View file

@ -17,12 +17,6 @@ import org.kde.plasma.private.mobileshell 1.0 as MobileShell
Item {
id: root
layer.enabled: true
onFocusChanged: {
if (focus) {
favoritesGrid.forceActiveFocus();
}
}
required property bool interactive
required property var searchWidget
@ -41,6 +35,14 @@ Item {
signal openConfigureRequested()
Connections {
target: parent
function onFocusRequested() {
favoritesGrid.forceActiveFocus();
}
}
function goToBeginning() {
goToBeginningAnim.restart();
}

View file

@ -22,12 +22,12 @@ MobileShell.GridView {
cacheBuffer: cellHeight * 20 // 10 rows above and below
reuseItems: true
Controls.ScrollBar.vertical: Controls.ScrollBar {
policy: Controls.ScrollBar.AlwaysOn
}
Controls.ScrollBar.vertical: Controls.ScrollBar {}
onFocusChanged: {
if (focus) {
Connections {
target: parent
function onFocusRequested() {
forceActiveFocus();
}
}

View file

@ -65,7 +65,7 @@ Item {
anchors.rightMargin: root.rightMargin
function focusChild() {
currentItem.childFocus = true;
currentItem.focusRequested();
}
onCurrentIndexChanged: focusChild()
@ -74,8 +74,7 @@ Item {
height: swipeView.height
width: swipeView.width
property alias childFocus: favoritesView.focus
signal focusRequested()
// open wallpaper menu when held on click
TapHandler {
@ -101,7 +100,7 @@ Item {
width: swipeView.width
height: swipeView.height
property alias childFocus: gridAppList.focus
signal focusRequested()
GridAppList {
id: gridAppList