mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 01:24:03 +02:00
Add "Open Folder" button to file browser dialog
This commit is contained in:
parent
cb3dfa0457
commit
fd467caf86
1 changed files with 26 additions and 1 deletions
|
@ -203,6 +203,7 @@ ModalWindow {
|
|||
var row = fileTableView.currentRow;
|
||||
|
||||
if (row === -1) {
|
||||
openFolderButton.enabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -213,6 +214,7 @@ ModalWindow {
|
|||
} else {
|
||||
currentSelection.text = "";
|
||||
}
|
||||
openFolderButton.enabled = currentSelectionIsFolder
|
||||
}
|
||||
|
||||
function navigateUp() {
|
||||
|
@ -389,6 +391,13 @@ ModalWindow {
|
|||
|
||||
rows++;
|
||||
}
|
||||
|
||||
fileTableView.selection.clear();
|
||||
if (model.count > 0 && fileTableView.activeFocus) {
|
||||
fileTableView.currentRow = 0;
|
||||
fileTableView.selection.select(0);
|
||||
d.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -617,6 +626,16 @@ ModalWindow {
|
|||
Keys.onReturnPressed: okAction.trigger()
|
||||
KeyNavigation.up: selectionType
|
||||
KeyNavigation.left: selectionType
|
||||
KeyNavigation.right: openFolderButton
|
||||
}
|
||||
|
||||
Button {
|
||||
id: openFolderButton
|
||||
text: "Open Folder"
|
||||
enabled: false
|
||||
action: openFolderAction
|
||||
KeyNavigation.up: selectionType
|
||||
KeyNavigation.left: openButton
|
||||
KeyNavigation.right: cancelButton
|
||||
}
|
||||
|
||||
|
@ -624,7 +643,7 @@ ModalWindow {
|
|||
id: cancelButton
|
||||
action: cancelAction
|
||||
KeyNavigation.up: selectionType
|
||||
KeyNavigation.left: openButton
|
||||
KeyNavigation.left: openFolderButton
|
||||
KeyNavigation.right: fileTableView.contentItem
|
||||
Keys.onReturnPressed: { canceled(); root.enabled = false }
|
||||
}
|
||||
|
@ -694,6 +713,12 @@ ModalWindow {
|
|||
}
|
||||
}
|
||||
|
||||
Action {
|
||||
id: openFolderAction
|
||||
text: "Open Folder"
|
||||
onTriggered: { fileTableView.navigateToCurrentRow(); }
|
||||
}
|
||||
|
||||
Action {
|
||||
id: cancelAction
|
||||
text: "Cancel"
|
||||
|
|
Loading…
Reference in a new issue