mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
dialer can now be dismissed by deleting numbers; white on black visuals
This commit is contained in:
parent
d344ffef3a
commit
28e7ccacd8
2 changed files with 20 additions and 9 deletions
|
|
@ -6,8 +6,9 @@ Text {
|
||||||
height: parent.buttonHeight
|
height: parent.buttonHeight
|
||||||
horizontalAlignment: Qt.AlignHCenter
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
verticalAlignment: Qt.AlignVCenter
|
verticalAlignment: Qt.AlignVCenter
|
||||||
|
color: dialer.textColor
|
||||||
font.pixelSize: Math.floor((width - (units.largeSpacing)) / 2)
|
font.pixelSize: Math.floor((width - (units.largeSpacing)) / 2)
|
||||||
property alias sub: longHold.text;
|
property alias sub: longHold.text
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
@ -26,16 +27,17 @@ Text {
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: longHold
|
id: longHold
|
||||||
visible: text.length > 0
|
|
||||||
opacity: 0.7
|
|
||||||
height: parent.height
|
|
||||||
width: parent.width / 3
|
|
||||||
verticalAlignment: Qt.AlignVCenter
|
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
|
height: parent.height
|
||||||
|
width: parent.width / 3
|
||||||
|
verticalAlignment: Qt.AlignVCenter
|
||||||
|
visible: text.length > 0
|
||||||
|
opacity: 0.7
|
||||||
|
|
||||||
font.pixelSize: parent.pixelSize * .8
|
font.pixelSize: parent.pixelSize * .8
|
||||||
|
color: dialer.textColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,10 @@ import "../components"
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: dialer
|
id: dialer
|
||||||
color: "white"
|
color: "black"
|
||||||
opacity: 0.5
|
opacity: 0.8
|
||||||
|
|
||||||
|
property color textColor: "white"
|
||||||
property bool calling: false // needs to be connected to a system service
|
property bool calling: false // needs to be connected to a system service
|
||||||
property bool enableButtons: calling
|
property bool enableButtons: calling
|
||||||
|
|
||||||
|
|
@ -37,6 +38,7 @@ Rectangle {
|
||||||
horizontalAlignment: Qt.AlignRight
|
horizontalAlignment: Qt.AlignRight
|
||||||
verticalAlignment: Qt.AlignVCenter
|
verticalAlignment: Qt.AlignVCenter
|
||||||
font.pixelSize: one.font.pixelSize
|
font.pixelSize: one.font.pixelSize
|
||||||
|
color: textColor
|
||||||
}
|
}
|
||||||
|
|
||||||
Grid {
|
Grid {
|
||||||
|
|
@ -81,7 +83,14 @@ Rectangle {
|
||||||
}
|
}
|
||||||
DialerIconButton {
|
DialerIconButton {
|
||||||
source: "edit-clear"
|
source: "edit-clear"
|
||||||
callback: function() { status.text = status.text.substr(0, status.text.length - 1); }
|
callback: function() {
|
||||||
|
if (status.text.length > 0) {
|
||||||
|
status.text = status.text.substr(0, status.text.length - 1);
|
||||||
|
} else {
|
||||||
|
dialer.calling = true;
|
||||||
|
dialer.calling = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue