mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Better preferences dialog initial state
This commit is contained in:
parent
d9651c6d4b
commit
18d6a09dc9
3 changed files with 12 additions and 0 deletions
|
@ -62,6 +62,13 @@ Window {
|
||||||
|
|
||||||
sections.push(sectionBuilder.createObject(prefControls, { name: category }));
|
sections.push(sectionBuilder.createObject(prefControls, { name: category }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sections.length) {
|
||||||
|
sections[0].expanded = true;
|
||||||
|
if (sections.length === 1) {
|
||||||
|
sections[0].expandable = false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Flickable {
|
Flickable {
|
||||||
|
|
|
@ -7,6 +7,7 @@ import "."
|
||||||
|
|
||||||
Preference {
|
Preference {
|
||||||
id: root
|
id: root
|
||||||
|
property bool expandable: true
|
||||||
property bool expanded: false
|
property bool expanded: false
|
||||||
property string name: "Header"
|
property string name: "Header"
|
||||||
property real spacing: 8
|
property real spacing: 8
|
||||||
|
@ -42,7 +43,10 @@ Preference {
|
||||||
|
|
||||||
VrControls.FontAwesome {
|
VrControls.FontAwesome {
|
||||||
id: toggle
|
id: toggle
|
||||||
|
width: root.expandable ? height : 0
|
||||||
anchors { left: parent.left; top: parent.top; margins: root.spacing }
|
anchors { left: parent.left; top: parent.top; margins: root.spacing }
|
||||||
|
visible: root.expandable
|
||||||
|
enabled: root.expandable
|
||||||
rotation: root.expanded ? 0 : -90
|
rotation: root.expanded ? 0 : -90
|
||||||
text: "\uf078"
|
text: "\uf078"
|
||||||
Behavior on rotation { PropertyAnimation {} }
|
Behavior on rotation { PropertyAnimation {} }
|
||||||
|
|
|
@ -20,6 +20,7 @@ DISTFILES += \
|
||||||
../../interface/resources/qml/controls/*.qml \
|
../../interface/resources/qml/controls/*.qml \
|
||||||
../../interface/resources/qml/dialogs/*.qml \
|
../../interface/resources/qml/dialogs/*.qml \
|
||||||
../../interface/resources/qml/dialogs/fileDialog/*.qml \
|
../../interface/resources/qml/dialogs/fileDialog/*.qml \
|
||||||
|
../../interface/resources/qml/dialogs/preferences/*.qml \
|
||||||
../../interface/resources/qml/desktop/*.qml \
|
../../interface/resources/qml/desktop/*.qml \
|
||||||
../../interface/resources/qml/menus/*.qml \
|
../../interface/resources/qml/menus/*.qml \
|
||||||
../../interface/resources/qml/styles/*.qml \
|
../../interface/resources/qml/styles/*.qml \
|
||||||
|
|
Loading…
Reference in a new issue