|
|
|
@ -4,6 +4,7 @@ import QtQuick.Controls 2.12
|
|
|
|
|
import QtQuick.Layouts 1.12 |
|
|
|
|
import NERvGear 1.0 as NVG |
|
|
|
|
import NERvGear.Preferences 1.0 as P |
|
|
|
|
import NERvGear.Controls 1.0 |
|
|
|
|
|
|
|
|
|
import "." |
|
|
|
|
|
|
|
|
@ -27,18 +28,16 @@ NVG.Window {
|
|
|
|
|
property var configuration |
|
|
|
|
property var old_style_cfg |
|
|
|
|
|
|
|
|
|
ColumnLayout { |
|
|
|
|
id: root |
|
|
|
|
Page { |
|
|
|
|
id: cfg_page |
|
|
|
|
anchors.fill: parent |
|
|
|
|
anchors.margins: 16 |
|
|
|
|
anchors.topMargin: 0 |
|
|
|
|
|
|
|
|
|
Row { |
|
|
|
|
spacing: window.width - 120 |
|
|
|
|
header: TitleBar { |
|
|
|
|
text: qsTr("Settings") |
|
|
|
|
|
|
|
|
|
standardButtons: Dialog.Save | Dialog.Reset |
|
|
|
|
|
|
|
|
|
ToolButton { |
|
|
|
|
text: qsTr("Save") |
|
|
|
|
onClicked: { |
|
|
|
|
onAccepted: { |
|
|
|
|
configuration = rootPreference.save(); |
|
|
|
|
let index = configuration["index"]; |
|
|
|
|
widget.settings[Common.stylesURL[index]] = configuration[Common.stylesURL[index]]; |
|
|
|
@ -47,11 +46,8 @@ NVG.Window {
|
|
|
|
|
widget.settings.current_style = Common.stylesURL[index]; |
|
|
|
|
styleDialog.active = false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ToolButton { |
|
|
|
|
text: qsTr("Reset") |
|
|
|
|
onClicked: { |
|
|
|
|
onReset: { |
|
|
|
|
styleLoader.load(); |
|
|
|
|
let cfg = rootPreference.save(); |
|
|
|
|
let index = cfg["index"]; |
|
|
|
@ -60,13 +56,12 @@ NVG.Window {
|
|
|
|
|
widget.setStyleURL(Qt.resolvedUrl(Common.stylesURL[widget.settings.styles["index"]])); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Label { |
|
|
|
|
Layout.alignment: Qt.AlignCenter |
|
|
|
|
text: qsTr("Settings") |
|
|
|
|
font.pixelSize: 24 |
|
|
|
|
} |
|
|
|
|
ColumnLayout { |
|
|
|
|
id: root |
|
|
|
|
anchors.fill: parent |
|
|
|
|
anchors.margins: 16 |
|
|
|
|
anchors.topMargin: 0 |
|
|
|
|
|
|
|
|
|
Flickable { |
|
|
|
|
Layout.fillWidth: true |
|
|
|
@ -88,7 +83,6 @@ NVG.Window {
|
|
|
|
|
|
|
|
|
|
onPreferenceEdited: { |
|
|
|
|
let cfg = rootPreference.save(); |
|
|
|
|
// console.log(JSON.stringify(cfg, null, 2)); |
|
|
|
|
let index = cfg["index"]; |
|
|
|
|
if (widget.settings.styles["index"] !== index) { |
|
|
|
|
widget.setStyleURL(""); |
|
|
|
@ -168,6 +162,7 @@ NVG.Window {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onClosing: { |
|
|
|
|
widget.setStyleURL(""); |
|
|
|
|