Commit 4c6a6fe1 authored by Björn Feber's avatar Björn Feber

[containments/desktop] Port desktop settings pages to QQC2+Kirigami FormLayout and modernize UI

Summary:
* Port to QQC2+Kirigami FormLayout (except for the mimetype table, there is no QQC2 equivalent)
* Improve some strings
* Follow the KDE HIG
* Improve look of buttons and other controls

{F6797612}
{F6797613}
{F6797614}

Test Plan: Configure a Folder View widget and go through the three settings pages.

Reviewers: #plasma, #vdg, davidedmundson, filipf, ngraham

Reviewed By: #plasma, #vdg, davidedmundson, filipf, ngraham

Subscribers: ngraham, filipf, davidedmundson, #vdg, plasma-devel, #plasma

Tags: #plasma

Maniphest Tasks: T10586

Differential Revision: https://phabricator.kde.org/D20878
parent cfbb1385
......@@ -18,8 +18,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
import QtQuick 2.4
import QtQuick.Controls 1.0
import QtQuick 2.5
import QtQuick.Controls 2.5
import QtQuick.Dialogs 1.1
import QtQuick.Layouts 1.0
......@@ -28,7 +28,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kquickcontrolsaddons 2.0
import org.kde.kconfig 1.0 // for KAuthorized
import org.kde.kirigami 2.4 as Kirigami
import org.kde.kirigami 2.5 as Kirigami
import org.kde.private.desktopcontainment.desktop 0.1 as Desktop
import org.kde.private.desktopcontainment.folder 0.1 as Folder
......@@ -36,9 +36,6 @@ import org.kde.private.desktopcontainment.folder 0.1 as Folder
Item {
id: configIcons
width: childrenRect.width
height: childrenRect.height
property bool isPopup: (plasmoid.location !== PlasmaCore.Types.Floating)
property string cfg_icon: plasmoid.configuration.icon
......@@ -149,7 +146,7 @@ Item {
id: alignment
Layout.fillWidth: true
model: [i18n("Align Left"), i18n("Align Right")]
model: [i18n("Align left"), i18n("Align right")]
}
CheckBox {
......@@ -233,10 +230,10 @@ Item {
Kirigami.FormData.label: i18n("Icon size:")
minimumValue: 0
maximumValue: 5
from: 0
to: 5
stepSize: 1
tickmarksEnabled: true
snapMode: Slider.SnapAlways
}
RowLayout {
......@@ -278,8 +275,8 @@ Item {
Kirigami.FormData.label: i18n("Text lines:")
minimumValue: 1
maximumValue: 10
from: 1
to: 10
stepSize: 1
}
......@@ -320,7 +317,8 @@ Item {
Button {
id: previewSettings
text: i18n("More Preview Options...")
icon.name: "configure"
text: i18n("Configure Preview Plugins...")
onClicked: {
previewPluginsDialog.visible = true;
......
......@@ -17,21 +17,18 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
import QtQuick 2.0
import QtQuick.Controls 1.0
import QtQuick 2.5
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.0
import org.kde.plasma.plasmoid 2.0
import org.kde.kirigami 2.4 as Kirigami
import org.kde.kirigami 2.5 as Kirigami
import org.kde.private.desktopcontainment.folder 0.1 as Folder
Item {
id: configLocation
width: childrenRect.width
height: childrenRect.height
property string cfg_url
property alias cfg_labelMode: labelMode.currentIndex
property alias cfg_labelText: labelText.text
......@@ -40,7 +37,7 @@ Item {
onCfg_urlChanged: applyConfig()
function applyConfig(force) {
if (!force && locationGroup.current != null) {
if (!force && locationGroup.checkedButton != null) {
return;
}
......@@ -73,13 +70,15 @@ Item {
onPlacesChanged: applyConfig(true)
}
ExclusiveGroup {
ButtonGroup {
id: locationGroup
onCurrentChanged: {
if (current == locationDesktop) {
buttons: [locationDesktop, locationCurrentActivity, locationPlace, locationCustom]
onCheckedButtonChanged: {
if (checkedButton == locationDesktop) {
cfg_url = "desktop:/";
} else if (current == locationCurrentActivity) {
} else if (checkedButton == locationCurrentActivity) {
cfg_url = "activities:/current/";
}
}
......@@ -94,7 +93,6 @@ Item {
Kirigami.FormData.label: i18n("Show:")
text: i18n("Desktop folder")
exclusiveGroup: locationGroup
}
RadioButton {
......@@ -102,26 +100,19 @@ Item {
visible: placesModel.activityLinkingEnabled
text: i18n("Files linked to the current activity")
exclusiveGroup: locationGroup
}
RadioButton {
id: locationPlace
text: i18n("Places panel item:")
RowLayout {
RadioButton {
id: locationPlace
exclusiveGroup: locationGroup
text: i18n("Places panel item:")
onCheckedChanged: {
locationPlaceValue.enabled = checked;
onCheckedChanged: {
locationPlaceValue.enabled = checked;
}
}
}
RowLayout {
Layout.fillWidth: true
Item {
width: units.largeSpacing
}
ComboBox {
id: locationPlaceValue
......@@ -144,24 +135,19 @@ Item {
}
}
RadioButton {
id: locationCustom
exclusiveGroup: locationGroup
text: i18n("Custom location:")
}
RowLayout {
Layout.fillWidth: true
Item {
width: units.largeSpacing
RadioButton {
id: locationCustom
text: i18n("Custom location:")
}
TextField {
id: locationCustomValue
enabled: locationCustom.checked
Layout.fillWidth: true
placeholderText: i18n("Type a path or a URL here")
placeholderText: i18n("Type path or URL...")
onEnabledChanged: {
if (enabled && text != "") {
......@@ -176,7 +162,7 @@ Item {
}
}
Button {
iconName: "document-open"
icon.name: "document-open"
enabled: locationCustom.checked
......@@ -201,7 +187,6 @@ Item {
ComboBox {
id: labelMode
visible: titleVisible
Layout.fillWidth: true
Kirigami.FormData.label: i18n("Title:")
......@@ -209,18 +194,18 @@ Item {
}
RowLayout {
Layout.fillWidth: true
visible: titleVisible
Item {
width: units.largeSpacing
}
TextField {
id: labelText
Layout.fillWidth: true
enabled: (labelMode.currentIndex == 3)
placeholderText: i18n("Enter custom title here")
placeholderText: i18n("Enter custom title...")
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment