Added list view for all subcategories.

Split elements into their own widgets.
This commit is contained in:
armored-dragon 2024-09-20 05:04:52 -05:00
parent 983f6e8809
commit 2034662233
No known key found for this signature in database
GPG key ID: C7207ACC3382AD8B
5 changed files with 135 additions and 17 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

View file

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="24px"
viewBox="0 -960 960 960"
width="24px"
fill="#5f6368"
version="1.1"
id="svg1"
sodipodi:docname="back_arrow.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1" />
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="48.541667"
inkscape:cx="11.9897"
inkscape:cy="12"
inkscape:window-width="2560"
inkscape:window-height="1363"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg1" />
<path
d="m313-440 224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"
id="path1"
style="fill:#ffffff" />
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,45 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
Item {
height: 60
width: parent.width
id: root
z: 1 // FIXME: Layout issue? Shouldn't need to adjust the z-index but I do.
Rectangle {
anchors.fill: parent;
color: "black"
}
Image {
source: "../img/back_arrow.png"
anchors.verticalCenter: parent.verticalCenter
height: 40
width: 40
x: current_page == "Settings" ? -40 : 10
Behavior on x {
NumberAnimation {
duration: 200
easing.type: Easing.InOutCubic
}
}
MouseArea {
anchors.fill: parent
onClicked: {
current_page = "Settings";
}
}
}
Text {
text: current_page
color: "white"
font.pointSize: 18
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
horizontalAlignment: Text.AlignHCenter
}
}

View file

@ -0,0 +1,28 @@
import QtQuick 2.15
Item {
width: parent.width
height: 60
Rectangle {
width: parent.width
height: parent.height
color: index % 2 === 0 ? Qt.rgba(0,0,0,0) : Qt.rgba(0.15,0.15,0.15,1)
anchors.fill: parent
}
Text {
text: page_name
color: "white"
font.pointSize: 16
anchors.verticalCenter: parent.verticalCenter
x: 10
}
MouseArea {
anchors.fill: parent
onClicked: {
current_page = page_name;
}
}
}

View file

@ -1,7 +1,8 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.3
import controlsUit 1.0 as HifiControlsUit
import "./qml_widgets"
// TODO: Some default values wait until component is completed. Is this necessary?
@ -13,27 +14,31 @@ Rectangle {
anchors.horizontalCenter: parent.horizontalCenter
id: root
property string current_page: "Graphics"
property var pages: ["Graphics", "Audio", "Controls", "Privacy and Security"]
property string current_page: "Settings"
// Navigation Header
Item {
height: 60
HeaderElement {
id: header
}
// Home page
ScrollView {
width: parent.width
id: home_page
Rectangle {
anchors.fill: parent;
color: "black"
}
Text {
y: 10
text: current_page
color: "white"
font.pointSize: 18
ColumnLayout {
width: parent.width
visible: current_page == "Settings"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
horizontalAlignment: Text.AlignHCenter
width: parent.width - 10
y: header.height
spacing: 0
Repeater {
model: pages.length
delegate: SettingSubviewListElement {
property string page_name: pages[index];
}
}
}
}
@ -409,6 +414,7 @@ Rectangle {
color: "white"
}
// FIXME: QML Slider binding loop
Slider {
id: fov_slider
from: 20