Port Dialpad to Kirigami

No functional or visual changes
This commit is contained in:
Jonah Brüchert 2019-06-23 13:30:17 +02:00 committed by Jonah Brüchert
parent 690a709dc8
commit e2160d3a02
7 changed files with 36 additions and 37 deletions

View file

@ -19,9 +19,11 @@
import QtQuick 2.4
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import QtQuick.Controls 2.2 as Controls
import org.kde.kirigami 2.2 as Kirigami
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras
Item {
id: delegateParent
@ -83,7 +85,7 @@ Item {
RowLayout {
width: parent.width
//FIXME: ad hoc icons
PlasmaCore.IconItem {
Kirigami.Icon {
width: units.iconSizes.medium
height: width
source: {
@ -98,20 +100,20 @@ Item {
}
}
ColumnLayout {
PlasmaComponents.Label {
Controls.Label {
text: "Name (todo)"
}
PlasmaComponents.Label {
Controls.Label {
text: model.number
Layout.fillWidth: true
}
}
ColumnLayout {
PlasmaComponents.Label {
Controls.Label {
Layout.alignment: Qt.AlignRight
text: Qt.formatTime(model.time, Qt.locale().timeFormat(Locale.ShortFormat));
}
PlasmaComponents.Label {
Controls.Label {
Layout.alignment: Qt.AlignRight
text: i18n("Duration: %1", secondsToTimeString(model.duration));
visible: model.duration > 0

View file

@ -21,8 +21,10 @@
import QtQuick 2.4
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import QtQuick.Controls 2.2 as Controls
import org.kde.kirigami 2.2 as Kirigami
Item {
id: root
@ -38,12 +40,12 @@ Item {
Rectangle {
anchors.fill: parent
z: -1
color: PlasmaCore.ColorScope.highlightColor
color: Kirigami.Theme.highlightColor
radius: units.smallSpacing
opacity: mouse.pressed ? 0.4 : 0
Behavior on opacity {
OpacityAnimator {
duration: units.longDuration
duration: Kirigami.Units.longDuration
easing.type: Easing.InOutQuad
}
}
@ -86,17 +88,17 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
PlasmaComponents.Label {
Controls.Label {
id: main
font.pixelSize: units.gridUnit * 2
text: root.display || root.text
opacity: special? 0.4 : 1.0
opacity: special ? 0.4 : 1.0
Layout.minimumWidth: parent.width
horizontalAlignment: Text.AlignHCenter
}
PlasmaComponents.Label {
Controls.Label {
id: longHold
text: root.subdisplay || root.sub

View file

@ -20,8 +20,10 @@
import QtQuick 2.4
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import QtQuick.Controls 2.2 as Controls
import org.kde.kirigami 2.2 as Kirigami
Item {
id: buttonRoot
@ -40,7 +42,7 @@ Item {
Rectangle {
anchors.fill: parent
z: -1
color: PlasmaCore.ColorScope.highlightColor
color: Kirigami.Theme.highlightColor
radius: units.smallSpacing
opacity: mouse.pressed ? 0.4 : 0
Behavior on opacity {
@ -53,13 +55,13 @@ Item {
Row {
anchors.centerIn: parent
PlasmaCore.IconItem {
Kirigami.Icon {
id: icon
anchors.verticalCenter: parent.verticalCenter
width: height
height: buttonRoot.size || buttonRoot.height * 0.6
}
PlasmaComponents.Label {
Controls.Label {
id: label
height: buttonRoot.height
anchors.verticalCenter: parent.verticalCenter

View file

@ -20,16 +20,16 @@
import QtQuick 2.0
import QtQuick.Layouts 1.2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kirigami 2.5 as Kirigami
GridLayout {
id: pad
columns: 3
rowSpacing: 10
columnSpacing: 10
Layout.leftMargin: units.largeSpacing * 2
Layout.rightMargin: units.largeSpacing * 2
Layout.leftMargin: Kirigami.Units.largeSpacing * 2
Layout.rightMargin: Kirigami.Units.largeSpacing * 2
property var callback
property var pressedCallback
@ -64,7 +64,7 @@ GridLayout {
enabled: status.text.length > 0
opacity: enabled ? 1 : 0.5
source: "call-start"
size: units.gridUnit * 3
size: Kirigami.Units.gridUnit * 3
callback: function() {
call(status.text);
}
@ -77,7 +77,7 @@ GridLayout {
enabled: status.text.length > 0
opacity: enabled ? 1 : 0.5
source: "edit-clear"
size: units.gridUnit * 2
size: Kirigami.Units.gridUnit * 2
callback: pad.deleteCallback
}
}

View file

@ -1,20 +1,16 @@
import QtQuick 2.0
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls 2.2 as Controls
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
// TODO: search through contacts while typing
PlasmaComponents.TextField {
Controls.TextField {
id: root
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignBottom
style: TextFieldStyle {
background: Rectangle {
opacity: 0
}
background: Rectangle {
opacity: 0
}
// append some text to the end of this input

View file

@ -19,10 +19,9 @@
*/
import QtQuick 2.3
import QtQuick.Controls 1.3
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.1
import QtQuick.LocalStorage 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras
ApplicationWindow {

View file

@ -1,5 +1,3 @@
set(plasmaphonedialer_SRCS
main.cpp
dialerutils.cpp