mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-28 06:33:09 +00:00
homescreens/Halcyon: trigger children using signals instead of focus property
This commit is contained in:
parent
4fc8582da5
commit
c3882691bc
3 changed files with 16 additions and 15 deletions
|
|
@ -18,12 +18,6 @@ Item {
|
||||||
id: root
|
id: root
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
|
|
||||||
onFocusChanged: {
|
|
||||||
if (focus) {
|
|
||||||
favoritesGrid.forceActiveFocus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
required property bool interactive
|
required property bool interactive
|
||||||
required property var searchWidget
|
required property var searchWidget
|
||||||
|
|
||||||
|
|
@ -41,6 +35,14 @@ Item {
|
||||||
|
|
||||||
signal openConfigureRequested()
|
signal openConfigureRequested()
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: parent
|
||||||
|
|
||||||
|
function onFocusRequested() {
|
||||||
|
favoritesGrid.forceActiveFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function goToBeginning() {
|
function goToBeginning() {
|
||||||
goToBeginningAnim.restart();
|
goToBeginningAnim.restart();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,12 +22,12 @@ MobileShell.GridView {
|
||||||
cacheBuffer: cellHeight * 20 // 10 rows above and below
|
cacheBuffer: cellHeight * 20 // 10 rows above and below
|
||||||
reuseItems: true
|
reuseItems: true
|
||||||
|
|
||||||
Controls.ScrollBar.vertical: Controls.ScrollBar {
|
Controls.ScrollBar.vertical: Controls.ScrollBar {}
|
||||||
policy: Controls.ScrollBar.AlwaysOn
|
|
||||||
}
|
|
||||||
|
|
||||||
onFocusChanged: {
|
Connections {
|
||||||
if (focus) {
|
target: parent
|
||||||
|
|
||||||
|
function onFocusRequested() {
|
||||||
forceActiveFocus();
|
forceActiveFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ Item {
|
||||||
anchors.rightMargin: root.rightMargin
|
anchors.rightMargin: root.rightMargin
|
||||||
|
|
||||||
function focusChild() {
|
function focusChild() {
|
||||||
currentItem.childFocus = true;
|
currentItem.focusRequested();
|
||||||
}
|
}
|
||||||
|
|
||||||
onCurrentIndexChanged: focusChild()
|
onCurrentIndexChanged: focusChild()
|
||||||
|
|
@ -74,8 +74,7 @@ Item {
|
||||||
height: swipeView.height
|
height: swipeView.height
|
||||||
width: swipeView.width
|
width: swipeView.width
|
||||||
|
|
||||||
|
signal focusRequested()
|
||||||
property alias childFocus: favoritesView.focus
|
|
||||||
|
|
||||||
// open wallpaper menu when held on click
|
// open wallpaper menu when held on click
|
||||||
TapHandler {
|
TapHandler {
|
||||||
|
|
@ -101,7 +100,7 @@ Item {
|
||||||
width: swipeView.width
|
width: swipeView.width
|
||||||
height: swipeView.height
|
height: swipeView.height
|
||||||
|
|
||||||
property alias childFocus: gridAppList.focus
|
signal focusRequested()
|
||||||
|
|
||||||
GridAppList {
|
GridAppList {
|
||||||
id: gridAppList
|
id: gridAppList
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue