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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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