mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
Click on blank part of dialog to deselect item
This commit is contained in:
parent
eddfe4847a
commit
4da1c0ac4d
3 changed files with 22 additions and 3 deletions
|
@ -79,6 +79,9 @@ ModalWindow {
|
|||
fileTableModel.folder = initialFolder;
|
||||
|
||||
iconText = root.title !== "" ? hifi.glyphs.scriptUpload : "";
|
||||
|
||||
// Clear selection when click on external frame.
|
||||
frameClicked.connect(function() { d.clearSelection(); });
|
||||
}
|
||||
|
||||
Item {
|
||||
|
@ -87,6 +90,13 @@ ModalWindow {
|
|||
height: pane.height
|
||||
anchors.margins: 0
|
||||
|
||||
MouseArea {
|
||||
// Clear selection when click on internal unused area.
|
||||
anchors.fill: parent
|
||||
drag.target: root
|
||||
onClicked: d.clearSelection()
|
||||
}
|
||||
|
||||
Row {
|
||||
id: navControls
|
||||
anchors {
|
||||
|
@ -228,6 +238,12 @@ ModalWindow {
|
|||
fileTableModel.folder = homeDestination;
|
||||
return true;
|
||||
}
|
||||
|
||||
function clearSelection() {
|
||||
fileTableView.selection.clear();
|
||||
fileTableView.currentRow = -1;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
FolderListModel {
|
||||
|
@ -392,9 +408,7 @@ ModalWindow {
|
|||
rows++;
|
||||
}
|
||||
|
||||
fileTableView.selection.clear();
|
||||
fileTableView.currentRow = -1;
|
||||
d.update();
|
||||
d.clearSelection();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,8 @@ Frame {
|
|||
readonly property int frameMarginTop: hifi.dimensions.modalDialogMargin.y + (frameContent.hasTitle ? hifi.dimensions.modalDialogTitleHeight + 10 : 0)
|
||||
readonly property int frameMarginBottom: hifi.dimensions.modalDialogMargin.y
|
||||
|
||||
signal frameClicked();
|
||||
|
||||
anchors {
|
||||
fill: parent
|
||||
topMargin: -frameMarginTop
|
||||
|
@ -47,6 +49,7 @@ Frame {
|
|||
anchors.fill: parent
|
||||
drag.target: window
|
||||
enabled: window.draggable
|
||||
onClicked: window.frameClicked();
|
||||
}
|
||||
|
||||
Item {
|
||||
|
|
|
@ -22,5 +22,7 @@ Window {
|
|||
property int colorScheme: hifi.colorSchemes.light
|
||||
property bool draggable: false
|
||||
|
||||
signal frameClicked();
|
||||
|
||||
anchors.centerIn: draggable ? undefined : parent
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue