2023-06-28 23:46:03 -04:00
|
|
|
import QtCore
|
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Controls.Basic
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
|
|
|
Item {
|
2023-07-01 11:34:21 -04:00
|
|
|
id: root
|
2023-06-28 23:46:03 -04:00
|
|
|
property string title: ""
|
|
|
|
property Item contentItem: null
|
2023-07-01 11:34:21 -04:00
|
|
|
property Item advancedSettings: null
|
2023-10-24 12:13:32 -04:00
|
|
|
property bool showAdvancedSettingsButton: true
|
|
|
|
property bool showRestoreDefaultsButton: true
|
2023-07-09 13:05:06 -04:00
|
|
|
property var openFolderDialog
|
2023-07-01 11:34:21 -04:00
|
|
|
signal restoreDefaultsClicked
|
2023-10-24 12:13:32 -04:00
|
|
|
signal downloadClicked
|
2023-06-28 23:46:03 -04:00
|
|
|
|
|
|
|
onContentItemChanged: function() {
|
|
|
|
if (contentItem) {
|
2023-07-01 11:34:21 -04: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-28 23:46:03 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ScrollView {
|
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
|
|
|
padding: 15
|
|
|
|
rightPadding: 20
|
|
|
|
contentWidth: availableWidth
|
2023-07-01 11:34:21 -04:00
|
|
|
contentHeight: innerColumn.height
|
2023-06-28 23:46:03 -04:00
|
|
|
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
|
|
|
|
|
|
|
|
Theme {
|
|
|
|
id: theme
|
|
|
|
}
|
|
|
|
|
2023-07-01 11:34:21 -04:00
|
|
|
ColumnLayout {
|
|
|
|
id: innerColumn
|
2023-06-28 23:46:03 -04:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2023-07-01 11:34:21 -04: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
|
2023-10-24 12:13:32 -04:00
|
|
|
visible: showRestoreDefaultsButton
|
2023-07-01 11:34:21 -04:00
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Restore Defaults")
|
2023-08-07 13:54:13 -04:00
|
|
|
font.pixelSize: theme.fontSizeLarge
|
2023-07-01 11:34:21 -04:00
|
|
|
Accessible.role: Accessible.Button
|
|
|
|
Accessible.name: text
|
2023-10-21 10:38:46 -04:00
|
|
|
Accessible.description: qsTr("Restores settings dialog to a default state")
|
2023-07-01 11:34:21 -04:00
|
|
|
onClicked: {
|
|
|
|
root.restoreDefaultsClicked();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MyButton {
|
|
|
|
id: advancedSettingsButton
|
|
|
|
anchors.right: parent.right
|
2023-10-24 12:13:32 -04:00
|
|
|
visible: root.advancedSettings && showAdvancedSettingsButton
|
2023-07-01 11:34:21 -04:00
|
|
|
width: implicitWidth
|
|
|
|
text: !advancedInner.visible ? qsTr("Advanced Settings") : qsTr("Hide Advanced Settings")
|
2023-08-07 13:54:13 -04:00
|
|
|
font.pixelSize: theme.fontSizeLarge
|
2023-07-01 11:34:21 -04:00
|
|
|
Accessible.role: Accessible.Button
|
|
|
|
Accessible.name: text
|
|
|
|
Accessible.description: qsTr("Shows/hides the advanced settings")
|
|
|
|
onClicked: {
|
|
|
|
advancedInner.visible = !advancedInner.visible;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-06-28 23:46:03 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|