diff --git a/applets/fifteenPuzzle/package/contents/ui/configAppearance.qml b/applets/fifteenPuzzle/package/contents/ui/configAppearance.qml --- a/applets/fifteenPuzzle/package/contents/ui/configAppearance.qml +++ b/applets/fifteenPuzzle/package/contents/ui/configAppearance.qml @@ -22,12 +22,13 @@ */ import QtQuick 2.0 -import QtQuick.Controls 1.2 as QtControls +import QtQuick.Controls 2.5 as QtControls import QtQuick.Layouts 1.0 as QtLayouts import QtQuick.Dialogs 1.2 as QtDialogs import org.kde.kquickcontrols 2.0 as KQC +import org.kde.kirigami 2.5 as Kirigami -QtLayouts.ColumnLayout { +Kirigami.FormLayout { id: appearancePage property alias cfg_boardSize: sizeSpinBox.value @@ -38,81 +39,77 @@ property alias cfg_useImage: useImageCheckBox.checked property alias cfg_imagePath: imagePathTextField.text - QtLayouts.GridLayout { - columns: 2 + QtControls.SpinBox { + id: sizeSpinBox + Kirigami.FormData.label: i18nc("@label:spinbox", "Size:") + } - QtControls.Label { - text: i18nc("@label:spinbox", "Size:") - QtLayouts.Layout.alignment: Qt.AlignRight - } + Item { + Kirigami.FormData.isSection: true + } - QtControls.SpinBox { - id: sizeSpinBox - } + QtControls.CheckBox { + id: showNumeralsCheckBox + text: i18nc("@option:check", "Show numbers") + } - QtControls.Label { - text: i18nc("@label:chooser", "Piece color:") - QtLayouts.Layout.alignment: Qt.AlignRight - } + KQC.ColorButton { + id: numberColorPicker + Kirigami.FormData.label: i18nc("@label:chooser", "Number color:") + enabled: showNumeralsCheckBox.checked + } - KQC.ColorButton { - id: pieceColorPicker - } + Item { + Kirigami.FormData.isSection: true + } - QtControls.Label { - text: i18nc("@label:chooser", "Number color:") - QtLayouts.Layout.alignment: Qt.AlignRight - } + KQC.ColorButton { + id: pieceColorPicker + Kirigami.FormData.label: i18nc("@label:chooser", "Piece color:") + enabled: !useImageCheckBox.checked + } - KQC.ColorButton { - id: numberColorPicker - } + QtControls.CheckBox { + id: useImageCheckBox + text: i18nc("@option:check", "Use custom image") + QtLayouts.Layout.alignment: Qt.AlignRight + } - QtControls.CheckBox { - id: useImageCheckBox - text: i18nc("@option:check", "Use custom image") - QtLayouts.Layout.alignment: Qt.AlignRight - } + QtLayouts.RowLayout { - QtLayouts.RowLayout { - QtControls.TextField { - id: imagePathTextField - QtLayouts.Layout.fillWidth: true - placeholderText: i18nc("@info:placeholder", "Path to custom image") - onTextChanged: useImageCheckBox.checked = true - } + QtControls.TextField { + id: imagePathTextField + enabled: useImageCheckBox.checked + QtLayouts.Layout.fillWidth: true + placeholderText: i18nc("@info:placeholder", "Path to custom image") + onTextChanged: useImageCheckBox.checked = true + } - QtControls.Button { - iconName: "document-open" - tooltip: i18nc("@info:tooltip", "Browse...") + QtControls.Button { + icon.name: "document-open" + enabled: useImageCheckBox.checked - onClicked: imagePicker.open() + onClicked: imagePicker.open() - QtDialogs.FileDialog { - id: imagePicker + QtDialogs.FileDialog { + id: imagePicker - title: i18nc("@title:window", "Choose an Image") + title: i18nc("@title:window", "Choose an Image") - folder: shortcuts.pictures + folder: shortcuts.pictures - // TODO ask QImageReader for supported formats - nameFilters: [ i18n("Image Files (*.png *.jpg *.jpeg *.bmp *.svg *.svgz)") ] + // TODO ask QImageReader for supported formats + nameFilters: [ i18n("Image Files (*.png *.jpg *.jpeg *.bmp *.svg *.svgz)") ] - onFileUrlChanged: { - imagePathTextField.text = fileUrl.toString().replace("file://", "") - } + onFileUrlChanged: { + imagePathTextField.text = fileUrl.toString().replace("file://", "") } } - } - QtControls.CheckBox { - id: showNumeralsCheckBox - QtLayouts.Layout.columnSpan: 2 - text: i18nc("@option:check", "Show numerals") - } - } + QtControls.ToolTip { + text: i18nc("@info:tooltip", "Browse...") + } - Item { // tighten layout - QtLayouts.Layout.fillHeight: true + } } }