2023-06-29 03:46:03 +00:00
|
|
|
import QtCore
|
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Controls.Basic
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
|
|
|
Item {
|
2023-07-01 15:34:21 +00:00
|
|
|
id: root
|
2023-06-29 03:46:03 +00:00
|
|
|
property string title: ""
|
|
|
|
property Item contentItem: null
|
2023-07-01 15:34:21 +00:00
|
|
|
property Item advancedSettings: null
|
2023-07-09 17:05:06 +00:00
|
|
|
property var openFolderDialog
|
2023-07-01 15:34:21 +00:00
|
|
|
signal restoreDefaultsClicked
|
2023-06-29 03:46:03 +00:00
|
|
|
|
|
|
|
onContentItemChanged: function() {
|
|
|
|
if (contentItem) {
|
2023-07-01 15:34:21 +00:00
|
|
|
contentItem.parent = contentInner;
|
|
|
|
contentItem.anchors.left = contentInner.left;
|
|
|
|
contentItem.anchors.right = contentInner.right;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
onAdvancedSettingsChanged: function() {
|
|
|
|
if (advancedSettings) {
|
|
|
|
advancedSettings.parent = advancedInner;
|
|
|
|
advancedSettings.anchors.left = advancedInner.left;
|
|
|
|
advancedSettings.anchors.right = advancedInner.right;
|
2023-06-29 03:46:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ScrollView {
|
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
|
|
|
padding: 15
|
|
|
|
rightPadding: 20
|
|
|
|
contentWidth: availableWidth
|
2023-07-01 15:34:21 +00:00
|
|
|
contentHeight: innerColumn.height
|
2023-06-29 03:46:03 +00:00
|
|
|
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
|
|
|
|
|
|
|
|
Theme {
|
|
|
|
id: theme
|
|
|
|
}
|
|
|
|
|
2023-07-01 15:34:21 +00:00
|
|
|
ColumnLayout {
|
|
|
|
id: innerColumn
|
2023-06-29 03:46:03 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2023-07-01 15:34:21 +00:00
|
|
|
anchors.margins: 15
|
|
|
|
spacing: 10
|
|
|
|
Column {
|
|
|
|
id: contentInner
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: advancedInner
|
|
|
|
visible: false
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
height: restoreDefaultsButton.height
|
|
|
|
MyButton {
|
|
|
|
id: restoreDefaultsButton
|
|
|
|
anchors.left: parent.left
|
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Restore Defaults")
|
|
|
|
Accessible.role: Accessible.Button
|
|
|
|
Accessible.name: text
|
|
|
|
Accessible.description: qsTr("Restores the settings dialog to a default state")
|
|
|
|
onClicked: {
|
|
|
|
root.restoreDefaultsClicked();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MyButton {
|
|
|
|
id: advancedSettingsButton
|
|
|
|
anchors.right: parent.right
|
|
|
|
visible: root.advancedSettings
|
|
|
|
width: implicitWidth
|
|
|
|
text: !advancedInner.visible ? qsTr("Advanced Settings") : qsTr("Hide Advanced Settings")
|
|
|
|
Accessible.role: Accessible.Button
|
|
|
|
Accessible.name: text
|
|
|
|
Accessible.description: qsTr("Shows/hides the advanced settings")
|
|
|
|
onClicked: {
|
|
|
|
advancedInner.visible = !advancedInner.visible;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-06-29 03:46:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|