Commit e8b9956b authored by Nicolas Fella's avatar Nicolas Fella

[kcm] Port to ScrollViewKCM

Use ScrollViewKCM + ListView instead of Repeater + ColumnLayout + Frame.

This makes for a more standard appearance and behaviour.
parent ec9746ca
......@@ -14,7 +14,7 @@ import org.kde.kcm 1.2
import org.kde.kaccounts 1.2 as KAccounts
SimpleKCM {
ScrollViewKCM {
id: component;
title: i18n("Account Details")
......@@ -42,7 +42,8 @@ SimpleKCM {
KAccounts.AccountServiceToggleJob { }
}
header: RowLayout {
header: ColumnLayout {
RowLayout {
Layout.fillWidth: true
Layout.margins: Kirigami.Units.smallSpacing
spacing: Kirigami.Units.smallSpacing
......@@ -65,19 +66,21 @@ SimpleKCM {
}
Controls.ToolButton {
icon.name: "edit-entry"
display: Controls.AbstractButton.IconOnly
Layout.preferredHeight: Kirigami.Units.iconSizes.large
Layout.preferredWidth: Kirigami.Units.iconSizes.large
onClicked: accountRenamer.open();
Controls.ToolTip {
visible: parent.hovered && !parent.pressed
text: i18nc("Button which spawns a dialog allowing the user to change the displayed account's human-readable name", "Change Account Display Name")
delay: Kirigami.Units.toolTipDelay
timeout: 5000
y: parent.height
}
}
}
Kirigami.Heading {
leftPadding: Kirigami.Units.smallSpacing
visible: servicesList.count > 0
level: 3
text: i18nc("Heading for a list of services available with this account", "Use This Account For")
}
}
footer: RowLayout {
Controls.Button {
......@@ -88,16 +91,11 @@ SimpleKCM {
}
}
Controls.Frame {
Layout.fillWidth: true
background: Rectangle {
Kirigami.Theme.colorSet: Kirigami.Theme.Button
color: Kirigami.Theme.backgroundColor
border {
width: 1
color: Qt.tint(Kirigami.Theme.textColor, Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.8))
}
}
view: ListView {
id: servicesList
clip: true
ColumnLayout {
anchors.fill: parent
spacing: Kirigami.Units.smallSpacing
......@@ -111,15 +109,8 @@ SimpleKCM {
wrapMode: Text.Wrap
text: i18nc("A text shown when an account has no configurable services", "There are no configurable services available for this account. You can still change its display name by clicking the edit icon above.")
}
Kirigami.Heading {
Layout.fillWidth: true
Layout.leftMargin: Kirigami.Units.smallSpacing
visible: servicesList.count > 0
level: 3
text: i18nc("Heading for a list of services available with this account", "Use This Account For")
}
Repeater {
id: servicesList
delegate: ColumnLayout {
Layout.fillWidth: true
Layout.leftMargin: Kirigami.Units.smallSpacing
......@@ -148,10 +139,4 @@ SimpleKCM {
}
}
}
Item {
Layout.fillWidth: true
height: Kirigami.Units.smallSpacing
}
}
}
}
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