Skip to content

Commit

Permalink
Center container widget.
Browse files Browse the repository at this point in the history
Replaced homepage with widget.
  • Loading branch information
Armored-Dragon committed Nov 16, 2024
1 parent 79fea1e commit 7b556cf
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 15 deletions.
24 changes: 24 additions & 0 deletions scripts/system/settings/qml_widgets/SettingCenterContainer.qml
Original file line number Diff line number Diff line change
@@ -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]
}
}
}
29 changes: 14 additions & 15 deletions scripts/system/settings/settings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,14 @@ Rectangle {
}

// Home page
ScrollView {
width: parent.width
height:parent.height
y: header.height
SettingCenterContainer {
id: home_page
visible: current_page == "Settings"

ColumnLayout {
width: parent.width
visible: current_page == "Settings"
anchors.horizontalCenter: parent.horizontalCenter
spacing: 0

Repeater {
model: pages.length
delegate: SettingSubviewListElement {
property string page_name: pages[index];
}
Repeater {
model: pages.length
delegate: SettingSubviewListElement {
property string page_name: pages[index];
}
}
}
Expand Down Expand Up @@ -459,6 +450,14 @@ Rectangle {
}
}

// Audio
SettingCenterContainer {
id: audio_page
visible: current_page == "Audio"
}



// Templates

// Messages from script
Expand Down

0 comments on commit 7b556cf

Please sign in to comment.