mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
Make pin screen follow color scheme
Use proper theme API instead of hardcoded colors
This commit is contained in:
parent
70794cd912
commit
0b6e1435ed
1 changed files with 13 additions and 18 deletions
|
|
@ -18,7 +18,6 @@ PlasmaCore.ColorScope {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
|
||||||
visible: simManager.pinRequired != OfonoSimManager.NoPin
|
visible: simManager.pinRequired != OfonoSimManager.NoPin
|
||||||
property OfonoSimManager simManager: ofonoSimManager
|
property OfonoSimManager simManager: ofonoSimManager
|
||||||
|
|
||||||
|
|
@ -30,6 +29,9 @@ PlasmaCore.ColorScope {
|
||||||
|
|
||||||
property bool pinsNotEqual: false
|
property bool pinsNotEqual: false
|
||||||
|
|
||||||
|
property color buttonColor: Qt.lighter(PlasmaCore.Theme.backgroundColor, 1.3)
|
||||||
|
property color buttonPressedColor: Qt.darker(PlasmaCore.Theme.backgroundColor, 1.08)
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: simManager
|
target: simManager
|
||||||
function onEnterPinComplete(error, errorString) {
|
function onEnterPinComplete(error, errorString) {
|
||||||
|
|
@ -54,7 +56,7 @@ PlasmaCore.ColorScope {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
color: Qt.rgba(250, 250, 250, 0.85)
|
color: Qt.hsla(PlasmaCore.Theme.backgroundColor.hslHue, PlasmaCore.Theme.backgroundColor.hslSaturation, PlasmaCore.Theme.backgroundColor.hslLightness, 0.85)
|
||||||
|
|
||||||
function backspace() {
|
function backspace() {
|
||||||
root.lastKey = ""
|
root.lastKey = ""
|
||||||
|
|
@ -143,7 +145,7 @@ PlasmaCore.ColorScope {
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
font.pointSize: 18
|
font.pointSize: 18
|
||||||
color: "#616161"
|
color: PlasmaCore.Theme.textColor
|
||||||
text: {
|
text: {
|
||||||
switch (simManager.pinRequired) {
|
switch (simManager.pinRequired) {
|
||||||
case OfonoSimManager.NoPin: return i18n("No pin (error)");
|
case OfonoSimManager.NoPin: return i18n("No pin (error)");
|
||||||
|
|
@ -168,7 +170,7 @@ PlasmaCore.ColorScope {
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
font.pointSize: 12
|
font.pointSize: 12
|
||||||
color: "#616161"
|
color: PlasmaCore.Theme.textColor
|
||||||
visible: (simManager.pinRequired !== OfonoSimManager.SimPuk) || root.puk === ""
|
visible: (simManager.pinRequired !== OfonoSimManager.SimPuk) || root.puk === ""
|
||||||
text: simManager.pinRetries && simManager.pinRetries[simManager.pinRequired] ? i18np("%1 attempt left", "%1 attempts left", simManager.pinRetries[simManager.pinRequired]) : ""
|
text: simManager.pinRetries && simManager.pinRetries[simManager.pinRequired] ? i18np("%1 attempt left", "%1 attempts left", simManager.pinRetries[simManager.pinRequired]) : ""
|
||||||
}
|
}
|
||||||
|
|
@ -188,26 +190,19 @@ PlasmaCore.ColorScope {
|
||||||
Layout.preferredHeight: Layout.preferredWidth
|
Layout.preferredHeight: Layout.preferredWidth
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
radius: width
|
radius: width
|
||||||
color: "#424242"
|
color: PlasmaCore.Theme.textColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Label { // number/letter
|
Label { // number/letter
|
||||||
visible: root.lastKey !== "" // hide label if no label needed
|
visible: root.lastKey !== "" // hide label if no label needed
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
color: "#424242"
|
color: PlasmaCore.Theme.textColor
|
||||||
text: root.lastKey
|
text: root.lastKey
|
||||||
font.pointSize: 20
|
font.pointSize: 20
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// separator
|
|
||||||
Rectangle {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
height: 1
|
|
||||||
color: "#eeeeee"
|
|
||||||
}
|
|
||||||
|
|
||||||
// number keys
|
// number keys
|
||||||
GridLayout {
|
GridLayout {
|
||||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
|
||||||
|
|
@ -230,13 +225,13 @@ PlasmaCore.ColorScope {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
radius: 5
|
radius: 5
|
||||||
color: "white"
|
color: root.buttonColor
|
||||||
visible: modelData.length > 0
|
visible: modelData.length > 0
|
||||||
|
|
||||||
AbstractButton {
|
AbstractButton {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onPressed: parent.color = "#e0e0e0"
|
onPressed: parent.color = root.buttonPressedColor
|
||||||
onReleased: parent.color = "white"
|
onReleased: parent.color = root.buttonColor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (modelData === "R") {
|
if (modelData === "R") {
|
||||||
pinScreen.backspace();
|
pinScreen.backspace();
|
||||||
|
|
@ -262,7 +257,7 @@ PlasmaCore.ColorScope {
|
||||||
verticalOffset: 1
|
verticalOffset: 1
|
||||||
radius: 4
|
radius: 4
|
||||||
samples: 6
|
samples: 6
|
||||||
color: "#e0e0e0"
|
color: Qt.darker(PlasmaCore.Theme.backgroundColor, 1.2)
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaComponents.Label {
|
PlasmaComponents.Label {
|
||||||
|
|
@ -270,7 +265,7 @@ PlasmaCore.ColorScope {
|
||||||
text: modelData
|
text: modelData
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
font.pointSize: 18
|
font.pointSize: 18
|
||||||
color: "#424242"
|
color: PlasmaCore.Theme.textColor
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
PlasmaCore.IconItem {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue