diff --git a/src/qml/ElisaConfigurationDialog.qml b/src/qml/ElisaConfigurationDialog.qml index c46835b1..56811868 100644 --- a/src/qml/ElisaConfigurationDialog.qml +++ b/src/qml/ElisaConfigurationDialog.qml @@ -1,160 +1,125 @@ /* * Copyright 2017 Matthieu Gallien * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ import QtQuick 2.11 import QtQuick.Controls 2.4 import QtQuick.Layouts 1.12 import QtQuick.Window 2.12 import QtQml.Models 2.3 import org.kde.kirigami 2.5 as Kirigami Window { id: dialog title: i18n("Configure") visible: true modality: Qt.ApplicationModal minimumWidth: 600 minimumHeight: 400 Shortcut { sequence: StandardKey.Cancel onActivated: close() } SystemPalette { id: myPalette colorGroup: SystemPalette.Active } Component { id: highlightBar Rectangle { width: 200; height: 50 color: myPalette.highlight } } - RowLayout { - spacing: 0 - + Rectangle { anchors.fill: parent - anchors.margins: 0 - - ListView { - id: pagesList - - Layout.fillHeight: true - Layout.preferredWidth: 150 - boundsBehavior: Flickable.StopAtBounds + color: myPalette.window - delegate: ItemDelegate { - text: model.pageName - icon.name: model.iconName + ColumnLayout { + spacing: 0 - width: pagesList.width + anchors.fill: parent - onClicked: pagesList.currentIndex = index + Kirigami.Heading { + text: i18n('General') + Layout.leftMargin: 5 + Layout.rightMargin: 5 } - model: ListModel { - id: settingsPagesModel + GeneralConfiguration { + Layout.fillWidth: true + Layout.topMargin: 10 + Layout.leftMargin: 20 + Layout.rightMargin: 10 } - ScrollBar.vertical: ScrollBar { - id: scrollBar + Kirigami.Heading { + text: i18n('Music Search Paths') + Layout.leftMargin: 5 + Layout.rightMargin: 5 + Layout.topMargin: 15 } - highlight: highlightBar - } - - Kirigami.Separator { - Layout.fillHeight: true - } - - Rectangle { - Layout.fillHeight: true - Layout.fillWidth: true - - color: myPalette.window - - ColumnLayout { - spacing: 0 - - anchors.fill: parent - - StackLayout { - Layout.fillWidth: true - Layout.fillHeight: true - - Layout.leftMargin: 10 - Layout.rightMargin: 10 - Layout.topMargin: 10 - Layout.bottomMargin: 10 - - currentIndex: pagesList.currentIndex + FileScanningConfiguration { + Layout.fillWidth: true + Layout.fillHeight: true + Layout.leftMargin: 10 + Layout.rightMargin: 10 + Layout.topMargin: 10 + } - GeneralConfiguration { - } + DialogButtonBox { + Layout.fillWidth: true - FileScanningConfiguration { - } + Button { + text: i18n("OK") + DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole } - DialogButtonBox { - Layout.fillWidth: true + Button { + text: i18n("Apply") + DialogButtonBox.buttonRole: DialogButtonBox.ApplyRole - Button { - text: i18n("OK") - DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole - } - - Button { - text: i18n("Apply") - DialogButtonBox.buttonRole: DialogButtonBox.ApplyRole - - enabled: config.isDirty - } + enabled: config.isDirty + } - Button { - text: i18n("Cancel") - DialogButtonBox.buttonRole: DialogButtonBox.RejectRole - } + Button { + text: i18n("Cancel") + DialogButtonBox.buttonRole: DialogButtonBox.RejectRole + } - onAccepted: { - config.save() - close() - } + onAccepted: { + config.save() + close() + } - onApplied: config.save() + onApplied: config.save() - onRejected: close() - } + onRejected: close() } } } - - Component.onCompleted: { - settingsPagesModel.insert(0, { "pageName": i18nc("Settings page about main preference", "General"), "iconName": 'settings-configure' }) - settingsPagesModel.insert(1, { "pageName": i18nc("Settings page about music search folders configuration", "Music Search Folders"), "iconName": 'folder-music' }) - } }