Skip to content

Commit

Permalink
Forward unhandled key events to the cluster
Browse files Browse the repository at this point in the history
This way the ivi can be the active window and the cluster can still be
controlled

Change-Id: Ib600104b12ad2cf1a842dc683c35a9319257bf5c
Reviewed-by: Nedim Hadzic <[email protected]>
  • Loading branch information
Gagi2k committed Sep 1, 2016
1 parent 9ebe067 commit dc7f8ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ Rectangle {
root.height = Window.height
}

//Forwards the keys to the cluster to handle it without being the active window
Keys.forwardTo: cluster ? cluster.clusterItem : null

Item {
width: Style.screenWidth
height: Style.screenHeight
Expand Down Expand Up @@ -87,9 +90,13 @@ Rectangle {
width: Style.clusterWidth
visible: false

property Item clusterItem: clusterItem

color: "black"

Cluster {}
Cluster {
id: clusterItem
}

function calculateSize() {
print (Screen.width, Screen.height)
Expand All @@ -104,12 +111,8 @@ Rectangle {
cluster.show()
calculateSize()
}
}
}

Window.onActiveChanged: {
if (Window.active && !WindowManager.runningOnDesktop)
cluster.requestActivate()
}
}

Component.onCompleted: {
Expand Down
2 changes: 1 addition & 1 deletion sysui/Cluster/Cluster.qml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Item {
}
}

Keys.forwardTo: Style.debugMode ? [layouter] : null
Keys.forwardTo: Style.debugMode ? [layouter] : widgetBase

property var layoutTarget//: notifications

Expand Down

0 comments on commit dc7f8ff

Please sign in to comment.