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-10-24 12:13:32 -04:00
|
|
|
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-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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-28 23:46:03 -04:00
|
|
|
ScrollView {
|
2024-01-22 14:41:47 -05:00
|
|
|
id: scrollView
|
2023-06-28 23:46:03 -04:00
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
2024-01-22 14:41:47 -05:00
|
|
|
topPadding: 15
|
|
|
|
leftPadding: 5
|
2023-06-28 23:46:03 -04:00
|
|
|
contentWidth: availableWidth
|
2023-07-01 11:34:21 -04:00
|
|
|
contentHeight: innerColumn.height
|
2024-01-22 14:41:47 -05:00
|
|
|
ScrollBar.vertical: ScrollBar {
|
|
|
|
parent: scrollView.parent
|
|
|
|
anchors.top: scrollView.top
|
|
|
|
anchors.left: scrollView.right
|
|
|
|
anchors.bottom: scrollView.bottom
|
|
|
|
}
|
2023-06-28 23:46:03 -04:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
2024-06-24 18:49:23 -04:00
|
|
|
Layout.topMargin: 20
|
2023-07-01 11:34:21 -04:00
|
|
|
height: restoreDefaultsButton.height
|
2024-01-22 14:41:47 -05:00
|
|
|
MySettingsButton {
|
2023-07-01 11:34:21 -04:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-06-28 23:46:03 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|