Skip to content

Commit

Permalink
Fixed the Music ClusterWidget to correctly show in the IC
Browse files Browse the repository at this point in the history
Also enabled the IC for multi-process support

Change-Id: I91902d4471b534e7a22d034b81a64be139c7d08b
Reviewed-by: Nedim Hadzic <[email protected]>
  • Loading branch information
Gagi2k committed Mar 31, 2016
1 parent e8c5221 commit 06f7c31
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 22 deletions.
7 changes: 6 additions & 1 deletion ClusterAndHUD.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@

import QtQuick 2.1
import QtQuick.Window 2.1
import io.qt.ApplicationManager 1.0
import utils 1.0
import "sysui/Cluster"

Main {
id: root

Window {
id: cluster
title: "CSD"
height: 720
width: 1920
Expand All @@ -45,5 +47,8 @@ Main {
Cluster {}
}

Component.onCompleted: Style.withCluster = true
Component.onCompleted: {
WindowManager.registerOutputWindow(cluster)
Style.withCluster = true
}
}
4 changes: 2 additions & 2 deletions apps/com.pelagicore.music/ClusterWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import controls 1.0
import "."

Item {
width: 800
width: 1300
height: parent.height

ListView {
Expand All @@ -44,7 +44,7 @@ Item {
height: parent.height
anchors.centerIn: parent
clip: true
model: MusicProvider.model
model: MusicProvider.nowPlaying.model
currentIndex: MusicProvider.currentIndex
highlight: Rectangle {
color: Style.colorWhite; opacity: 0.25
Expand Down
6 changes: 3 additions & 3 deletions apps/com.pelagicore.music/Music.qml
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ AppUIScreen {

onClusterKeyPressed: {
if (key === Qt.Key_Down) {
MusicProvider.currentIndex--
MusicProvider.next()
}
else if (key === Qt.Key_Up) {
MusicProvider.currentIndex++
MusicProvider.previous()
}
}

onRaiseApp: {
MusicProvider.initialize()
}

//cluster: ClusterWidget {}
cluster: ClusterWidget {}

AppStackView {
id: stack
Expand Down
5 changes: 3 additions & 2 deletions modules/utils/AppUIScreen.qml
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,14 @@ ApplicationManagerWindow {

ApplicationManagerWindow {
id: cluster
width: parent ? parent.width : 0
height: parent ? parent.height : 0
width: parent ? parent.width : Style.cellWidth * 24
height: parent ? parent.height : Style.cellHeight * 24
visible: false
Item {
id: clusterContainer
anchors.fill: parent
}
color: "transparent"

Component.onCompleted: {
if (pelagicoreWindow._clusterSet) {
Expand Down
27 changes: 14 additions & 13 deletions sysui/Cluster/Middle.qml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ Item {
width: stack.width
height: stack.height
title: "NAVIGATOR"

Tracer {}
}
WidgetContainer {
id: musicContainer
Expand All @@ -94,23 +92,26 @@ Item {
Connections {
target: AppsService
onClusterWidgetReady: {
// if (category === "media") {
// musicContainer.content = item
// stack.currentIndex = 1
// }
if (category === "navigation") {
navContainer.content = item
var container;
if (category === "media") {
container = musicContainer
stack.currentIndex = 1
} else if (category === "navigation") {
container = navContainer
stack.currentIndex = 0
} else {
container = otherContainer
stack.currentIndex = 2
}
// else {
// otherContainer.content = item
// stack.currentIndex = 2
// }

item.parent = container
container.content = item
item.width = container.width
item.height = container.height
}
}

Keys.onPressed: {
//print("key pressed", Qt.Key_Plus, event.key)
if (event.key === Qt.Key_Right) {
if (stack.currentIndex < stack.count)
stack.currentIndex++
Expand Down
4 changes: 3 additions & 1 deletion sysui/Cluster/WidgetContainer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ Item {
default property alias content: container.children

Keys.onPressed: {
if (container.children[0])
if (container.children[0]) {
WindowManager.setSurfaceWindowProperty(container.children[0], "keyPressed", event.key)
WindowManager.setSurfaceWindowProperty(container.children[0], "keyPressed", 0)
}
}

Item {
Expand Down

0 comments on commit 06f7c31

Please sign in to comment.