Use FormLayout with twinFormLayouts for alignment of lockscreen config

Much simpler and also needed for correctly aligning with  wallpaper plugins
wilder-portage-prov
David Redondo 6 years ago
parent 0ec7a3e2cb
commit a3836058ce
  1. 44
      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")
}
}

Loading…
Cancel
Save