From a3836058ce2263dd549afc063845fa688b60d5ed Mon Sep 17 00:00:00 2001 From: David Redondo Date: Thu, 18 Jun 2020 11:19:01 +0200 Subject: [PATCH] Use FormLayout with twinFormLayouts for alignment of lockscreen config Much simpler and also needed for correctly aligning with wallpaper plugins --- lookandfeel/contents/lockscreen/config.qml | 44 ++++++---------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/lookandfeel/contents/lockscreen/config.qml b/lookandfeel/contents/lockscreen/config.qml index 921a03859..d8e2d3461 100644 --- a/lookandfeel/contents/lockscreen/config.qml +++ b/lookandfeel/contents/lockscreen/config.qml @@ -1,44 +1,22 @@ import QtQuick 2.5 import QtQuick.Controls 2.5 as QQC2 import QtQuick.Layouts 1.1 +import org.kde.kirigami 2.12 as Kirigami -ColumnLayout { +Kirigami.FormLayout { property alias cfg_alwaysShowClock: alwaysClock.checked property alias cfg_showMediaControls: showMediaControls.checked - spacing: 0 + twinFormLayouts: parentLayout - RowLayout { - spacing: units.largeSpacing / 2 - - QQC2.Label { - Layout.minimumWidth: formAlignment - units.largeSpacing //to match wallpaper config... - horizontalAlignment: Text.AlignRight - text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Clock:") - } - QQC2.CheckBox { - id: alwaysClock - text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "verb, to show something", "Always show") - } - Item { - Layout.fillWidth: true - } + QQC2.CheckBox { + id: alwaysClock + Kirigami.FormData.label: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Clock:") + text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "verb, to show something", "Show always") } - - RowLayout { - spacing: units.largeSpacing / 2 - - QQC2.Label { - Layout.minimumWidth: formAlignment - units.largeSpacing //to match wallpaper config... - horizontalAlignment: Text.AlignRight - text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Media controls:") - } - QQC2.CheckBox { - id: showMediaControls - text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "verb, to show something", "Show") - } - Item { - Layout.fillWidth: true - } + QQC2.CheckBox { + id: showMediaControls + Kirigami.FormData.label: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Media controls:") + text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "verb, to show something", "Show") } }