From 7a4c2a5caa4673f7be8158f39f7a52a765fb3a91 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Thu, 15 Dec 2022 15:07:04 -0700 Subject: [PATCH] kcmkwin/xwayland: put radio buttons in a FormLayout This is the typical way we do this. The result looks the same in a width-constrained window, but uses the more common FormLayout appearance for big windows. --- .../kwinxwayland/package/contents/ui/main.qml | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/src/kcmkwin/kwinxwayland/package/contents/ui/main.qml b/src/kcmkwin/kwinxwayland/package/contents/ui/main.qml index 8cd8bab25b..6601e4336c 100644 --- a/src/kcmkwin/kwinxwayland/package/contents/ui/main.qml +++ b/src/kcmkwin/kwinxwayland/package/contents/ui/main.qml @@ -25,7 +25,7 @@ KCM.SimpleKCM { implicitHeight: Kirigami.Units.gridUnit * 33 QQC2.ButtonGroup { - buttons: column.children + buttons: form.children exclusive: true checkedButton: buttons[kcm.settings.xwaylandEavesdrops] onCheckedButtonChanged: { @@ -41,23 +41,28 @@ KCM.SimpleKCM { ColumnLayout { id: column - QQC2.Label { - Layout.fillWidth: true - text: i18n("Allow legacy X11 apps to read keystrokes typed in all apps:") - } + spacing: Kirigami.Units.smallSpacing - QQC2.RadioButton { - text: i18n("Never") - } - QQC2.RadioButton { - text: i18n("Only Meta, Control, Alt, and Shift keys") - } - QQC2.RadioButton { - text: i18n("All keys, but only while Meta, Ctrl, Alt, or Shift keys are pressed") - } - QQC2.RadioButton { - id: always - text: i18n("Always") + Kirigami.FormLayout { + id: form + + Layout.leftMargin: Kirigami.Units.gridUnit + Layout.rightMargin: Kirigami.Units.gridUnit + + QQC2.RadioButton { + Kirigami.FormData.label: i18n("Allow legacy X11 apps to read keystrokes typed in all apps:") + text: i18n("Never") + } + QQC2.RadioButton { + text: i18n("Only Meta, Control, Alt, and Shift keys") + } + QQC2.RadioButton { + text: i18n("All keys, but only while Meta, Ctrl, Alt, or Shift keys are pressed") + } + QQC2.RadioButton { + id: always + text: i18n("Always") + } } Kirigami.InlineMessage {