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

View file

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

View file

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