diff --git a/applets/appmenu/package/contents/ui/main.qml b/applets/appmenu/package/contents/ui/main.qml --- a/applets/appmenu/package/contents/ui/main.qml +++ b/applets/appmenu/package/contents/ui/main.qml @@ -18,7 +18,7 @@ */ import QtQuick 2.0 import QtQuick.Layouts 1.1 -import QtQuick.Controls 1.4 +import QtQuick.Controls 2.8 import org.kde.plasma.plasmoid 2.0 import org.kde.kquickcontrolsaddons 2.0 diff --git a/applets/digital-clock/package/contents/ui/configAppearance.qml b/applets/digital-clock/package/contents/ui/configAppearance.qml --- a/applets/digital-clock/package/contents/ui/configAppearance.qml +++ b/applets/digital-clock/package/contents/ui/configAppearance.qml @@ -29,8 +29,6 @@ QtLayouts.ColumnLayout { id: appearancePage - width: childrenRect.width - height: childrenRect.height signal configurationChanged @@ -229,21 +227,23 @@ QtControls.Button { id: boldCheckBox QtControls.ToolTip { + id: boldTooltip text: i18n("Bold text") } icon.name: "format-text-bold" checkable: true - Accessible.name: tooltip + Accessible.name: boldTooltip.text } QtControls.Button { id: italicCheckBox QtControls.ToolTip { + id: italicTooltip text: i18n("Italic text") } icon.name: "format-text-italic" checkable: true - Accessible.name: tooltip + Accessible.name: italicTooltip.text } } } diff --git a/applets/digital-clock/package/contents/ui/configTimeZones.qml b/applets/digital-clock/package/contents/ui/configTimeZones.qml --- a/applets/digital-clock/package/contents/ui/configTimeZones.qml +++ b/applets/digital-clock/package/contents/ui/configTimeZones.qml @@ -19,191 +19,82 @@ */ import QtQuick 2.0 -import QtQuick.Controls 1.2 as QtControls +import QtQuick.Controls 2.8 import QtQuick.Layouts 1.0 import QtQuick.Dialogs 1.1 import org.kde.plasma.private.digitalclock 1.0 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 Item { id: timeZonesPage - width: parent.width - height: parent.height property alias cfg_selectedTimeZones: timeZones.selectedTimeZones property alias cfg_wheelChangesTimezone: enableWheelCheckBox.checked - TimeZoneModel { - id: timeZones - - onSelectedTimeZonesChanged: { - if (selectedTimeZones.length === 0) { - messageWidget.visible = true; - - timeZones.selectLocalTimeZone(); - } - } - } - - // This is just for getting the column width - QtControls.CheckBox { - id: checkbox - visible: false - } - - ColumnLayout { anchors.fill: parent - Rectangle { - id: messageWidget + TimeZoneModel { + id: timeZones - anchors { - left: parent.left - right: parent.right - margins: 1 - } + onSelectedTimeZonesChanged: { + if (selectedTimeZones.length === 0) { + messageWidget.visible = true; - height: 0 - - //TODO: This is the actual color KMessageWidget uses as its base color but here it gives - // a different color, figure out why - //property color gradBaseColor: Qt.rgba(0.69, 0.5, 0, 1) - gradient: Gradient { - GradientStop { position: 0.0; color: "#FFD86D" } //Qt.lighter(messageWidget.gradBaseColor, 1.1) - GradientStop { position: 0.1; color: "#EAC360" } // messageWidget.gradBaseColor - GradientStop { position: 1.0; color: "#CAB064" } //Qt.darker(messageWidget.gradBaseColor, 1.1) - } - - radius: 5 - border.width: 1 - border.color: "#79735B" - - visible: false - - Behavior on visible { - ParallelAnimation { - PropertyAnimation { - target: messageWidget - property: "opacity" - to: messageWidget.visible ? 0 : 1.0 - easing.type: Easing.Linear - } - PropertyAnimation { - target: messageWidget - property: "Layout.minimumHeight" - to: messageWidget.visible ? 0 : messageWidgetLabel.height + (2 *units.largeSpacing) - easing.type: Easing.Linear - } + timeZones.selectLocalTimeZone(); } } + } - RowLayout { - anchors.fill: parent - anchors.margins: units.largeSpacing - anchors.leftMargin: units.smallSpacing - anchors.rightMargin: units.smallSpacing - spacing: units.smallSpacing - - PlasmaCore.IconItem { - anchors.verticalCenter: parent.verticalCenter - height: units.iconSizes.smallMedium - width: height - source: "dialog-warning" - } - - QtControls.Label { - id: messageWidgetLabel - anchors.verticalCenter: parent.verticalCenter - Layout.fillWidth: true - text: i18n("At least one time zone needs to be enabled. 'Local' was enabled automatically.") - verticalAlignment: Text.AlignVCenter - wrapMode: Text.WordWrap - } - - PlasmaComponents.ToolButton { - anchors.verticalCenter: parent.verticalCenter - iconName: "dialog-close" - flat: true - - onClicked: { - messageWidget.visible = false; - } - } - } + Kirigami.InlineMessage { + id: messageWidget + Layout.fillWidth: true + Layout.margins: Kirigami.Units.smallSpacing + type: Kirigami.MessageType.Warning + text: i18n("At least one time zone needs to be enabled. 'Local' was enabled automatically.") + showCloseButton: true } - QtControls.TextField { + TextField { id: filter Layout.fillWidth: true placeholderText: i18n("Search Time Zones") } - QtControls.TableView { - id: timeZoneView - - signal toggleCurrent - + ScrollView { + id: scroll Layout.fillWidth: true Layout.fillHeight: true - Keys.onSpacePressed: toggleCurrent() - - model: TimeZoneFilterProxy { - sourceModel: timeZones - filterString: filter.text - } + ListView { + id: timeZoneView + spacing: 5 - QtControls.TableViewColumn { - role: "checked" - width: checkbox.width - delegate: - QtControls.CheckBox { - id: checkBox - anchors.centerIn: parent - checked: styleData.value - activeFocusOnTab: false // only let the TableView as a whole get focus - onClicked: { - //needed for model's setData to be called - model.checked = checked; - } + model: TimeZoneFilterProxy { + sourceModel: timeZones + filterString: filter.text + } - Connections { - target: timeZoneView - onToggleCurrent: { - if (styleData.row === timeZoneView.currentRow) { - model.checked = !checkBox.checked - } - } - } + delegate: CheckDelegate { + id: checkbox + width: parent.width + text: !city || city.indexOf("UTC") === 0 ? comment : comment ? i18n("%1, %2 (%3)", city, region, comment) : i18n("%1, %2", city, region) + checked: model.checked + onToggled: { + model.checked = checkbox.checked } - - resizable: false - movable: false - } - QtControls.TableViewColumn { - role: "city" - title: i18n("City") - } - QtControls.TableViewColumn { - role: "region" - title: i18n("Region") - } - QtControls.TableViewColumn { - role: "comment" - title: i18n("Comment") + } } } RowLayout { Layout.fillWidth: true - QtControls.CheckBox { + CheckBox { id: enableWheelCheckBox text: i18n("Switch time zone with mouse wheel") } } - } } diff --git a/applets/digital-clock/plugin/timezonesi18n.cpp b/applets/digital-clock/plugin/timezonesi18n.cpp --- a/applets/digital-clock/plugin/timezonesi18n.cpp +++ b/applets/digital-clock/plugin/timezonesi18n.cpp @@ -460,6 +460,7 @@ {QStringLiteral("UTC+06:30"), i18nc("This is a generic time zone name, localize as needed", "UTC+06:30")}, {QStringLiteral("UTC+07:00"), i18nc("This is a generic time zone name, localize as needed", "UTC+07:00")}, {QStringLiteral("UTC+08:00"), i18nc("This is a generic time zone name, localize as needed", "UTC+08:00")}, + {QStringLiteral("UTC+08:30"), i18nc("This is a generic time zone name, localize as needed", "UTC+08:30")}, {QStringLiteral("UTC+09:00"), i18nc("This is a generic time zone name, localize as needed", "UTC+09:00")}, {QStringLiteral("UTC+09:30"), i18nc("This is a generic time zone name, localize as needed", "UTC+09:30")}, {QStringLiteral("UTC+10:00"), i18nc("This is a generic time zone name, localize as needed", "UTC+10:00")}, diff --git a/applets/systemmonitor/common/contents/ui/ConfigGeneral.qml b/applets/systemmonitor/common/contents/ui/ConfigGeneral.qml --- a/applets/systemmonitor/common/contents/ui/ConfigGeneral.qml +++ b/applets/systemmonitor/common/contents/ui/ConfigGeneral.qml @@ -17,8 +17,7 @@ */ import QtQuick 2.5 -import QtQuick.Controls 1.4 as QQC1 -import QtQuick.Controls 2.5 as QQC2 +import QtQuick.Controls 2.5 import QtQuick.Layouts 1.3 import org.kde.kirigami 2.5 as Kirigami @@ -119,23 +118,20 @@ anchors.left: parent.left anchors.right: parent.right - // QQC2 SpinBox doesn't cleanly support non-integer values, which can be - // worked around, but the code is messy and the user experience is - // somewhat poor. So for now, we stick with the QQC1 SpinBox - QQC1.SpinBox { + SpinBox { id: updateIntervalSpinBox - Kirigami.FormData.label: i18n("Update interval:") - decimals: 1 - suffix: i18ncp("Suffix for spinbox (seconds)", " second", - " seconds") - maximumValue: 1000 - stepSize: 0.1 - onValueChanged: cfg_updateInterval = value * 1000 - Component.onCompleted: value = cfg_updateInterval / 1000 + from: 100 + stepSize: 100 + to: 1000000 + textFromValue: function(value) { + var seconds = value / 1000 + return i18n("%1 seconds", seconds.toFixed(1)) + } + value: cfg_updateInterval + onValueModified: cfg_updateInterval = value } - Item { Kirigami.FormData.isSection: true } @@ -149,7 +145,7 @@ Repeater { id: repeater model: sourcesModel - QQC2.CheckBox { + CheckBox { id: checkBox text: model.friendlyName property string source: model.source diff --git a/sddm-theme/BreezeMenuStyle.qml b/sddm-theme/BreezeMenuStyle.qml --- a/sddm-theme/BreezeMenuStyle.qml +++ b/sddm-theme/BreezeMenuStyle.qml @@ -2,16 +2,16 @@ import org.kde.plasma.core 2.0 as PlasmaCore -import QtQuick.Controls.Styles 1.4 as QQCS -import QtQuick.Controls 1.3 as QQC +import QtQuick.Controls.Styles 1.4 +import QtQuick.Controls 2.8 -QQCS.MenuStyle { +MenuStyle { frame: Rectangle { color: PlasmaCore.ColorScope.backgroundColor border.color: Qt.tint(PlasmaCore.ColorScope.textColor, Qt.rgba(color.r, color.g, color.b, 0.7)) border.width: 1 } - itemDelegate.label: QQC.Label { + itemDelegate.label: Label { height: contentHeight * 1.2 verticalAlignment: Text.AlignVCenter color: styleData.selected ? PlasmaCore.ColorScope.highlightedTextColor : PlasmaCore.ColorScope.textColor diff --git a/sddm-theme/KeyboardButton.qml b/sddm-theme/KeyboardButton.qml --- a/sddm-theme/KeyboardButton.qml +++ b/sddm-theme/KeyboardButton.qml @@ -3,7 +3,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents -import QtQuick.Controls 1.3 as QQC +import QtQuick.Controls 2.8 PlasmaComponents.ToolButton { id: keyboardButton @@ -18,15 +18,15 @@ Component.onCompleted: currentIndex = Qt.binding(function() {return keyboard.currentLayout}); - menu: QQC.Menu { + menu: Menu { id: keyboardMenu style: BreezeMenuStyle {} Instantiator { id: instantiator model: keyboard.layouts onObjectAdded: keyboardMenu.insertItem(index, object) onObjectRemoved: keyboardMenu.removeItem( object ) - delegate: QQC.MenuItem { + delegate: MenuItem { text: modelData.longName property string shortName: modelData.shortName onTriggered: { diff --git a/sddm-theme/Main.qml b/sddm-theme/Main.qml --- a/sddm-theme/Main.qml +++ b/sddm-theme/Main.qml @@ -20,7 +20,7 @@ import QtQuick 2.8 import QtQuick.Layouts 1.1 -import QtQuick.Controls 1.1 +import QtQuick.Controls 2.8 import QtGraphicalEffects 1.0 import org.kde.plasma.core 2.0 as PlasmaCore diff --git a/sddm-theme/SessionButton.qml b/sddm-theme/SessionButton.qml --- a/sddm-theme/SessionButton.qml +++ b/sddm-theme/SessionButton.qml @@ -22,7 +22,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents -import QtQuick.Controls 1.3 as QQC +import QtQuick.Controls 2.8 PlasmaComponents.ToolButton { id: root @@ -40,15 +40,15 @@ currentIndex = sessionModel.lastIndex } - menu: QQC.Menu { + menu: Menu { id: menu style: BreezeMenuStyle {} Instantiator { id: instantiator model: sessionModel onObjectAdded: menu.insertItem(index, object) onObjectRemoved: menu.removeItem( object ) - delegate: QQC.MenuItem { + delegate: MenuItem { text: model.name onTriggered: { root.currentIndex = model.index diff --git a/wallpapers/image/imagepackage/platformcontents/phone/ui/config.qml b/wallpapers/image/imagepackage/platformcontents/phone/ui/config.qml --- a/wallpapers/image/imagepackage/platformcontents/phone/ui/config.qml +++ b/wallpapers/image/imagepackage/platformcontents/phone/ui/config.qml @@ -22,7 +22,7 @@ import org.kde.plasma.core 2.0 as Plasmacore import org.kde.plasma.wallpapers.image 2.0 as Wallpaper import org.kde.kquickcontrolsaddons 2.0 -import QtQuick.Controls 1.0 as QtControls +import QtQuick.Controls 2.8 Item { id: root @@ -41,7 +41,7 @@ //Rectangle { color: "orange"; x: formAlignment; width: formAlignment; height: 20 } - QtControls.ScrollView { + ScrollView { anchors.fill: parent frameVisible: true @@ -71,7 +71,7 @@ } } - QtControls.Button { + Button { anchors { bottom: parent.bottom horizontalCenter: parent.horizontalCenter diff --git a/wallpapers/image/imagepackage/platformcontents/phone/ui/customwallpaper.qml b/wallpapers/image/imagepackage/platformcontents/phone/ui/customwallpaper.qml --- a/wallpapers/image/imagepackage/platformcontents/phone/ui/customwallpaper.qml +++ b/wallpapers/image/imagepackage/platformcontents/phone/ui/customwallpaper.qml @@ -22,16 +22,16 @@ import org.kde.plasma.core 2.0 as Plasmacore import org.kde.plasma.wallpapers.image 2.0 as Wallpaper import org.kde.kquickcontrolsaddons 2.0 -import QtQuick.Controls 1.0 as QtControls +import QtQuick.Controls 2.8 Rectangle { id: root color: syspal.window anchors.fill: parent SystemPalette {id: syspal} - QtControls.ScrollView { + ScrollView { anchors.fill: parent frameVisible: true @@ -76,7 +76,7 @@ } } } - QtControls.Button { + Button { anchors { bottom: parent.bottom horizontalCenter: parent.horizontalCenter