Better preferences dialog initial state

This commit is contained in:
Brad Davis 2016-01-26 23:16:22 -08:00
parent d9651c6d4b
commit 18d6a09dc9
3 changed files with 12 additions and 0 deletions

View file

@ -62,6 +62,13 @@ Window {
sections.push(sectionBuilder.createObject(prefControls, { name: category }));
}
if (sections.length) {
sections[0].expanded = true;
if (sections.length === 1) {
sections[0].expandable = false
}
}
}
Flickable {

View file

@ -7,6 +7,7 @@ import "."
Preference {
id: root
property bool expandable: true
property bool expanded: false
property string name: "Header"
property real spacing: 8
@ -42,7 +43,10 @@ Preference {
VrControls.FontAwesome {
id: toggle
width: root.expandable ? height : 0
anchors { left: parent.left; top: parent.top; margins: root.spacing }
visible: root.expandable
enabled: root.expandable
rotation: root.expanded ? 0 : -90
text: "\uf078"
Behavior on rotation { PropertyAnimation {} }

View file

@ -20,6 +20,7 @@ DISTFILES += \
../../interface/resources/qml/controls/*.qml \
../../interface/resources/qml/dialogs/*.qml \
../../interface/resources/qml/dialogs/fileDialog/*.qml \
../../interface/resources/qml/dialogs/preferences/*.qml \
../../interface/resources/qml/desktop/*.qml \
../../interface/resources/qml/menus/*.qml \
../../interface/resources/qml/styles/*.qml \