Center container widget.

Replaced homepage with widget.
This commit is contained in:
armored-dragon 2024-09-20 07:04:14 -05:00
parent 7e876fa066
commit 83b2666fb5
No known key found for this signature in database
GPG key ID: C7207ACC3382AD8B
2 changed files with 38 additions and 15 deletions

View file

@ -0,0 +1,24 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.3
ScrollView {
width: parent.width
height:parent.height
y: header.height
id: root
ColumnLayout {
width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
spacing: 0
}
// For each child of index not of 0, append as child of index of 0.
// Append children of the custom element to the ColumnLayout.
Component.onCompleted: {
for (var i = 1; i < root.contentChildren.length; i++) {
root.contentChildren[i].parent = root.contentChildren[0]
}
}
}

View file

@ -23,23 +23,14 @@ Rectangle {
} }
// Home page // Home page
ScrollView { SettingCenterContainer {
width: parent.width
height:parent.height
y: header.height
id: home_page id: home_page
visible: current_page == "Settings"
ColumnLayout { Repeater {
width: parent.width model: pages.length
visible: current_page == "Settings" delegate: SettingSubviewListElement {
anchors.horizontalCenter: parent.horizontalCenter property string page_name: pages[index];
spacing: 0
Repeater {
model: pages.length
delegate: SettingSubviewListElement {
property string page_name: pages[index];
}
} }
} }
} }
@ -459,6 +450,14 @@ Rectangle {
} }
} }
// Audio
SettingCenterContainer {
id: audio_page
visible: current_page == "Audio"
}
// Templates // Templates
// Messages from script // Messages from script