diff --git a/kcmkwin/kwindesktop/kcm_kwin_virtualdesktops.desktop b/kcmkwin/kwindesktop/kcm_kwin_virtualdesktops.desktop --- a/kcmkwin/kwindesktop/kcm_kwin_virtualdesktops.desktop +++ b/kcmkwin/kwindesktop/kcm_kwin_virtualdesktops.desktop @@ -75,7 +75,7 @@ Name[zh_CN]=虚拟桌面 Name[zh_TW]=虛擬桌面 -Comment=Navigation, Number and Layout of Virtual Desktops +Comment=Configure navigation, number and layout of virtual desktops Comment[bs]=Navigacija, broj i izgled virtualnih desktopa Comment[ca]=Navegació, nombre i disposició dels escriptoris virtuals Comment[ca@valencia]=Navegació, nombre i disposició dels escriptoris virtuals diff --git a/kcmkwin/kwindesktop/package/contents/ui/main.qml b/kcmkwin/kwindesktop/package/contents/ui/main.qml --- a/kcmkwin/kwindesktop/package/contents/ui/main.qml +++ b/kcmkwin/kwindesktop/package/contents/ui/main.qml @@ -17,17 +17,18 @@ * Boston, MA 02110-1301, USA. */ -import QtQuick 2.1 +import QtQuick 2.5 +import QtQuick.Controls 2.5 as QQC2 import QtQuick.Layouts 1.1 -import QtQuick.Controls 2.4 as QtControls + +import org.kde.kcm 1.2 import org.kde.kirigami 2.5 as Kirigami import org.kde.plasma.core 2.1 as PlasmaCore -import org.kde.kcm 1.2 ScrollViewKCM { id: root - ConfigModule.quickHelp: i18n("Virtual Desktops") + ConfigModule.quickHelp: i18n("This module lets you configure the navigation, number and layout of virtual desktops.") Connections { target: kcm.desktopsModel @@ -48,7 +49,7 @@ id: listItem contentItem: RowLayout { - QtControls.TextField { + QQC2.TextField { id: nameField background: null @@ -84,7 +85,7 @@ }, Kirigami.Action { enabled: !model.IsMissing - iconName: "list-remove" + iconName: "edit-delete-remove" tooltip: i18nc("@info:tooltip", "Remove") onTriggered: kcm.desktopsModel.removeDesktop(model.Id) }] @@ -115,35 +116,6 @@ visible: kcm.desktopsModel.serverModified } - - RowLayout { - QtControls.Label { - text: i18n("Rows:") - } - - QtControls.SpinBox { - id: rowsSpinBox - - from: 1 - to: 20 - editable: true - - onValueModified: kcm.desktopsModel.rows = value - } - - Item { // Spacer - Layout.fillWidth: true - } - - QtControls.Button { - Layout.alignment: Qt.AlignRight - - text: i18nc("@action:button", "Add") - icon.name: "list-add" - - onClicked: kcm.desktopsModel.createDesktop(i18n("New Desktop")) - } - } } view: ListView { @@ -156,14 +128,14 @@ width: desktopsList.width backgroundColor: Kirigami.Theme.backgroundColor + Kirigami.Theme.inherit: false + Kirigami.Theme.colorSet: Kirigami.Theme.Window hoverEnabled: false supportsMouseEvents: false - Kirigami.Theme.inherit: false - Kirigami.Theme.colorSet: Kirigami.Theme.Window - - QtControls.Label { + Kirigami.Heading { + level: 2 text: i18n("Row %1", section) } } @@ -175,119 +147,146 @@ } } - footer: Kirigami.FormLayout { - Connections { - target: kcm - - onNavWrapsChanged: navWraps.checked = kcm.navWraps + footer: ColumnLayout { + RowLayout { + QQC2.Button { + text: i18nc("@action:button", "Add") + icon.name: "list-add" - onOsdEnabledChanged: osdEnabled.checked = kcm.osdEnabled - onOsdDurationChanged: osdDuration.value = kcm.osdDuration - onOsdTextOnlyChanged: osdTextOnly.checked = !kcm.osdTextOnly - } + onClicked: kcm.desktopsModel.createDesktop(i18n("New Desktop")) + } - QtControls.CheckBox { - id: navWraps + Item { // Spacer + Layout.fillWidth: true + } - Kirigami.FormData.label: i18n("Options:") + QQC2.SpinBox { + id: rowsSpinBox - text: i18n("Navigation wraps around") + from: 1 + to: 20 + editable: true - checked: kcm.navWraps + textFromValue: function(value, locale) { return i18np("1 Row", "%1 Rows", value)} - onCheckedChanged: kcm.navWraps = checked + onValueModified: kcm.desktopsModel.rows = value + } } - RowLayout { - Layout.fillWidth: true + Kirigami.FormLayout { + Connections { + target: kcm - QtControls.CheckBox { - id: animationEnabled + onNavWrapsChanged: navWraps.checked = kcm.navWraps - text: i18n("Show animation when switching:") + onOsdEnabledChanged: osdEnabled.checked = kcm.osdEnabled + onOsdDurationChanged: osdDuration.value = kcm.osdDuration + onOsdTextOnlyChanged: osdTextOnly.checked = !kcm.osdTextOnly + } - checked: kcm.animationsModel.enabled + QQC2.CheckBox { + id: navWraps - onCheckedChanged: kcm.animationsModel.enabled = checked - } + Kirigami.FormData.label: i18n("Options:") + + text: i18n("Navigation wraps around") - QtControls.ComboBox { - enabled: animationEnabled.checked + checked: kcm.navWraps - model: kcm.animationsModel - textRole: "NameRole" - currentIndex: kcm.animationsModel.currentIndex - onActivated: kcm.animationsModel.currentIndex = currentIndex + onCheckedChanged: kcm.navWraps = checked } - QtControls.Button { - enabled: animationEnabled.checked && kcm.animationsModel.currentConfigurable + RowLayout { + Layout.fillWidth: true - icon.name: "configure" + QQC2.CheckBox { + id: animationEnabled - onClicked: kcm.configureAnimation() - } + text: i18n("Show animation when switching:") - QtControls.Button { - enabled: animationEnabled.checked + checked: kcm.animationsModel.enabled - icon.name: "dialog-information" + onCheckedChanged: kcm.animationsModel.enabled = checked + } - onClicked: kcm.showAboutAnimation() - } + QQC2.ComboBox { + enabled: animationEnabled.checked - Item { - Layout.fillWidth: true - } - } + model: kcm.animationsModel + textRole: "NameRole" + currentIndex: kcm.animationsModel.currentIndex + onActivated: kcm.animationsModel.currentIndex = currentIndex + } - RowLayout { - Layout.fillWidth: true + QQC2.Button { + enabled: animationEnabled.checked && kcm.animationsModel.currentConfigurable - QtControls.CheckBox { - id: osdEnabled + icon.name: "configure" - text: i18n("Show on-screen display when switching:") + onClicked: kcm.configureAnimation() + } + + QQC2.Button { + enabled: animationEnabled.checked + + icon.name: "dialog-information" - checked: kcm.osdEnabled + onClicked: kcm.showAboutAnimation() + } - onToggled: kcm.osdEnabled = checked + Item { + Layout.fillWidth: true + } } - QtControls.SpinBox { - id: osdDuration + RowLayout { + Layout.fillWidth: true - enabled: osdEnabled.checked + QQC2.CheckBox { + id: osdEnabled - from: 0 - to: 10000 - stepSize: 100 + text: i18n("Show on-screen display when switching:") - textFromValue: function(value, locale) { return i18n("%1 ms", value)} + checked: kcm.osdEnabled - value: kcm.osdDuration + onToggled: kcm.osdEnabled = checked + } - onValueChanged: kcm.osdDuration = value - } - } + QQC2.SpinBox { + id: osdDuration - RowLayout { - Layout.fillWidth: true + enabled: osdEnabled.checked + + from: 0 + to: 10000 + stepSize: 100 + + textFromValue: function(value, locale) { return i18n("%1 ms", value)} - Item { - width: units.largeSpacing + value: kcm.osdDuration + + onValueChanged: kcm.osdDuration = value + } } - QtControls.CheckBox { - id: osdTextOnly + RowLayout { + Layout.fillWidth: true + + Item { + width: units.largeSpacing + } - enabled: osdEnabled.checked + QQC2.CheckBox { + id: osdTextOnly - text: i18n("Show desktop layout indicators") + enabled: osdEnabled.checked - checked: !kcm.osdTextOnly + text: i18n("Show desktop layout indicators") - onToggled: kcm.osdTextOnly = !checked + checked: !kcm.osdTextOnly + + onToggled: kcm.osdTextOnly = !checked + } } } } diff --git a/kcmkwin/kwindesktop/package/metadata.desktop b/kcmkwin/kwindesktop/package/metadata.desktop --- a/kcmkwin/kwindesktop/package/metadata.desktop +++ b/kcmkwin/kwindesktop/package/metadata.desktop @@ -62,7 +62,7 @@ Name[zh_CN]=虚拟桌面 Name[zh_TW]=虛擬桌面 -Comment=Navigation, Number and Layout of Virtual Desktops +Comment=Configure navigation, number and layout of virtual desktops Comment[bs]=Navigacija, broj i izgled virtualnih desktopa Comment[ca]=Navegació, nombre i disposició dels escriptoris virtuals Comment[ca@valencia]=Navegació, nombre i disposició dels escriptoris virtuals diff --git a/kcmkwin/kwindesktop/virtualdesktops.cpp b/kcmkwin/kwindesktop/virtualdesktops.cpp --- a/kcmkwin/kwindesktop/virtualdesktops.cpp +++ b/kcmkwin/kwindesktop/virtualdesktops.cpp @@ -41,7 +41,7 @@ , m_animationsModel(new AnimationsModel(this)) { KAboutData *about = new KAboutData(QStringLiteral("kcm_kwin_virtualdesktops"), - i18n("Configure Virtual Desktops"), + i18n("Virtual Desktops"), QStringLiteral("2.0"), QString(), KAboutLicense::GPL); setAboutData(about);