mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Add back the components, this fixes the sim pin page
This commit is contained in:
parent
aeea4f92ed
commit
d206d498c0
2 changed files with 85 additions and 0 deletions
48
shell/contents/components/DialerButton.qml
Normal file
48
shell/contents/components/DialerButton.qml
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
import QtQuick 2.0
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
|
||||
Text {
|
||||
width: parent.width / parent.columns
|
||||
height: parent.buttonHeight
|
||||
horizontalAlignment: Qt.AlignHCenter
|
||||
verticalAlignment: Qt.AlignVCenter
|
||||
color: dialer.textColor
|
||||
font.pixelSize: Math.floor((width - (units.largeSpacing)) / 2)
|
||||
property alias sub: longHold.text
|
||||
property var callback
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
if (callback) {
|
||||
callback();
|
||||
} else {
|
||||
addNumber(parent.text);
|
||||
}
|
||||
}
|
||||
|
||||
onPressAndHold: {
|
||||
if (longHold.visible) {
|
||||
addNumber(longHold.text);
|
||||
} else {
|
||||
addNumber(parent.text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
id: longHold
|
||||
anchors {
|
||||
top: parent.top
|
||||
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
|
||||
color: parent.color
|
||||
}
|
||||
}
|
||||
37
shell/contents/components/DialerIconButton.qml
Normal file
37
shell/contents/components/DialerIconButton.qml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
import QtQuick 2.0
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
|
||||
Item {
|
||||
width: parent.width / parent.columns
|
||||
height: parent.buttonHeight
|
||||
property var callback
|
||||
property string text
|
||||
property string sub
|
||||
property alias source: icon.source
|
||||
|
||||
PlasmaCore.IconItem {
|
||||
id: icon
|
||||
width: units.iconSizes.medium
|
||||
height: width
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
if (callback) {
|
||||
callback();
|
||||
} else {
|
||||
addNumber(parent.text);
|
||||
}
|
||||
}
|
||||
|
||||
onPressAndHold: {
|
||||
if (parent.sub.length > 0) {
|
||||
addNumber(parent.sub);
|
||||
} else {
|
||||
addNumber(parent.text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue