use colorscopes

This commit is contained in:
Marco Martin 2014-11-25 17:57:38 +01:00
parent 678585e5c5
commit 33984e3da9
3 changed files with 205 additions and 186 deletions

View file

@ -1,6 +1,7 @@
import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kio 1.0 as Kio
import org.kde.plasma.components 2.0 as PlasmaComponents
MouseArea {
id: root
@ -19,7 +20,7 @@ MouseArea {
source: model.ApplicationIconRole
}
Text {
PlasmaComponents.Label {
visible: text.length > 0
anchors {
@ -34,6 +35,6 @@ MouseArea {
text: model.ApplicationNameRole
font.pixelSize: theme.smallestFont.pixelSize
color: "white"
color: PlasmaCore.ColorScope.textColor
}
}

View file

@ -19,6 +19,7 @@
import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
MouseArea {
id: root
@ -124,13 +125,13 @@ MouseArea {
color: textGradientOverlay
}
Text {
PlasmaComponents.Label {
id: summaryText
anchors.fill: parent
clip: true
horizontalAlignment: root.expanded ? Qt.AlignHCenter : Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
color: "white"
color: PlasmaCore.ColorScope.textColor
text: summary + (root.expanded ? (body ? "\n" + body : '') :
(body ? '...' : ''))
}

View file

@ -295,15 +295,19 @@ MouseEventListener {
source: simManager.pinRequired != OfonoSimManager.NoPin ? Qt.resolvedUrl("Pin.qml") : ""
}
Rectangle {
PlasmaCore.ColorScope {
id: statusPanel
anchors {
top: parent.top
left: parent.left
right: parent.right
}
z: 1
height: units.iconSizes.small
z: 1
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
Rectangle {
anchors.fill: parent
color: Qt.rgba(0, 0, 0, 0.7)
PlasmaCore.DataSource {
@ -315,7 +319,7 @@ MouseEventListener {
PlasmaCore.IconItem {
id: strengthIcon
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
colorGroup: PlasmaCore.ColorScope.colorGroup
anchors {
left: parent.left
verticalCenter: parent.verticalCenter
@ -323,20 +327,20 @@ MouseEventListener {
width: units.iconSizes.small
height: width
}
Text {
PlasmaComponents.Label {
anchors {
left: strengthIcon.right
verticalCenter: parent.verticalCenter
}
text: netreg.strength + "% " + netreg.name
color: "white"
color: PlasmaCore.ColorScope.textColor
font.pixelSize: parent.height / 2
}
Text {
PlasmaComponents.Label {
id: clock
anchors.fill: parent
text: Qt.formatTime(timeSource.data.Local.DateTime, "hh:mm")
color: "white"
color: PlasmaCore.ColorScope.textColor
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
font.pixelSize: height / 2
@ -384,6 +388,7 @@ MouseEventListener {
}
}
}
}
SlidingPanel {
id: slidingPanel
@ -391,11 +396,22 @@ MouseEventListener {
height: homescreen.height
}
PlasmaCore.ColorScope {
z: 1
anchors {
top: statusPanel.bottom
bottom: parent.bottom
left: parent.left
right: parent.right
}
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
ListView {
id: notificationView
spacing: units.smallSpacing
anchors {
top: statusPanel.bottom
top: parent.top
bottom: stripe.top
left: parent.left
right: parent.right
@ -507,6 +523,7 @@ MouseEventListener {
delegate: HomeLauncher {}
Component.onCompleted : { console.log("WTF " + width) }
}
}
Component.onCompleted: {
//configure the view behavior