Make file browser dialog movable

This commit is contained in:
David Rowe 2016-05-25 13:49:01 +12:00
parent 1c4eed640f
commit 9ec6b77460
4 changed files with 13 additions and 3 deletions

View file

@ -30,6 +30,7 @@ ModalWindow {
implicitHeight: 480
minSize: Qt.vector2d(300, 240)
draggable: true
HifiConstants { id: hifi }

View file

@ -42,7 +42,7 @@ Frame {
}
radius: hifi.dimensions.borderRadius
// Allow dragging of the window
// Enable dragging of the window
MouseArea {
anchors.fill: parent
drag.target: window

View file

@ -42,6 +42,13 @@ Frame {
radius: hifi.dimensions.borderRadius
color: hifi.colors.faintGray
// Enable dragging of the window
MouseArea {
anchors.fill: parent
drag.target: window
enabled: window.draggable
}
Item {
visible: frameContent.hasTitle
anchors.fill: parent

View file

@ -14,11 +14,13 @@ import "."
Window {
id: window
anchors.centerIn: parent
modality: Qt.ApplicationModal
destroyOnCloseButton: true
destroyOnInvisible: true
frame: ModalFrame{}
frame: ModalFrame { }
property int colorScheme: hifi.colorSchemes.light
property bool draggable: false
anchors.centerIn: draggable ? undefined : parent
}