Upate general layout of file selection dialog

This commit is contained in:
David Rowe 2016-05-10 12:50:32 +12:00
parent 6e59abc8f6
commit 43ee64c251

View file

@ -78,8 +78,12 @@ ModalWindow {
Row { Row {
id: navControls id: navControls
anchors { left: parent.left; top: parent.top; margins: 8 } anchors {
spacing: 8 top: parent.top
topMargin: hifi.dimensions.contentMargin.y
left: parent.left
}
spacing: hifi.dimensions.contentSpacing.x
// FIXME implement back button // FIXME implement back button
//VrControls.ButtonAwesome { //VrControls.ButtonAwesome {
@ -119,7 +123,13 @@ ModalWindow {
id: currentDirectory id: currentDirectory
height: homeButton.height height: homeButton.height
style: TextFieldStyle { renderType: Text.QtRendering } style: TextFieldStyle { renderType: Text.QtRendering }
anchors { left: navControls.right; right: parent.right; top: parent.top; margins: 8 } anchors {
top: parent.top
topMargin: hifi.dimensions.contentMargin.y
left: navControls.right
leftMargin: hifi.dimensions.contentSpacing.x
right: parent.right
}
property var lastValidFolder: helper.urlToPath(model.folder) property var lastValidFolder: helper.urlToPath(model.folder)
onLastValidFolderChanged: text = lastValidFolder; onLastValidFolderChanged: text = lastValidFolder;
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
@ -179,7 +189,14 @@ ModalWindow {
FileTableView { FileTableView {
id: fileTableView id: fileTableView
anchors { left: parent.left; right: parent.right; top: currentDirectory.bottom; bottom: currentSelection.top; margins: 8 } anchors {
top: navControls.bottom
topMargin: hifi.dimensions.contentSpacing.y
left: parent.left
right: parent.right
bottom: currentSelection.top
bottomMargin: hifi.dimensions.contentSpacing.y
}
onDoubleClicked: navigateToRow(row); onDoubleClicked: navigateToRow(row);
focus: true focus: true
Keys.onReturnPressed: navigateToCurrentRow(); Keys.onReturnPressed: navigateToCurrentRow();
@ -277,7 +294,13 @@ ModalWindow {
TextField { TextField {
id: currentSelection id: currentSelection
style: TextFieldStyle { renderType: Text.QtRendering } style: TextFieldStyle { renderType: Text.QtRendering }
anchors { right: root.selectDirectory ? parent.right : selectionType.left; rightMargin: 8; left: parent.left; leftMargin: 8; top: selectionType.top } anchors {
left: parent.left
right: root.selectDirectory ? parent.right : selectionType.left
rightMargin: hifi.dimensions.contentSpacing.x
bottom: buttonRow.top
bottomMargin: hifi.dimensions.contentSpacing.y
}
readOnly: !root.saveDialog readOnly: !root.saveDialog
activeFocusOnTab: !readOnly activeFocusOnTab: !readOnly
onActiveFocusChanged: if (activeFocus) { selectAll(); } onActiveFocusChanged: if (activeFocus) { selectAll(); }
@ -286,7 +309,11 @@ ModalWindow {
FileTypeSelection { FileTypeSelection {
id: selectionType id: selectionType
anchors { bottom: buttonRow.top; bottomMargin: 8; right: parent.right; rightMargin: 8; left: buttonRow.left } anchors {
top: currentSelection.top
left: buttonRow.left
right: parent.right
}
visible: !selectDirectory visible: !selectDirectory
KeyNavigation.left: fileTableView KeyNavigation.left: fileTableView
KeyNavigation.right: openButton KeyNavigation.right: openButton
@ -294,19 +321,22 @@ ModalWindow {
Row { Row {
id: buttonRow id: buttonRow
anchors.right: parent.right anchors {
anchors.rightMargin: 8 right: parent.right
anchors.bottom: parent.bottom bottom: parent.bottom
anchors.bottomMargin: 8 }
spacing: 8 spacing: hifi.dimensions.contentSpacing.y
Button { Button {
id: openButton id: openButton
color: hifi.buttons.blue
action: okAction action: okAction
Keys.onReturnPressed: okAction.trigger() Keys.onReturnPressed: okAction.trigger()
KeyNavigation.up: selectionType KeyNavigation.up: selectionType
KeyNavigation.left: selectionType KeyNavigation.left: selectionType
KeyNavigation.right: cancelButton KeyNavigation.right: cancelButton
} }
Button { Button {
id: cancelButton id: cancelButton
action: cancelAction action: cancelAction