diff options
author | sanevala <samuel.nevala@digia.com> | 2013-02-12 12:19:51 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-19 13:50:41 +0100 |
commit | 7f1934362318e4c3ab6cdbdc2f71a8355d74202d (patch) | |
tree | d84157a80992a78e5a608fd028586278db4f9b55 | |
parent | c42e7baac98ba4c3db8995ac37c5d020b57b9df7 (diff) |
User cannot press cancel after folder up.
Moved cancel button on top of folder list views. Selected
file is not anymore emitted on cancel.
Change-Id: Ia7b666b4519fe03ca36c41d1694d2ad3ff4ace51
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
-rw-r--r-- | examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml b/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml index d61d35a14..c089f6b1b 100644 --- a/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml +++ b/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml @@ -52,10 +52,11 @@ Rectangle { signal fileSelected(string file) function selectFile(file) { - if (file != "") + if (file !== "") { folder = loader.item.folders.folder + fileBrowser.fileSelected(file) + } loader.sourceComponent = undefined - fileBrowser.fileSelected(file) } Loader { @@ -161,28 +162,6 @@ Rectangle { } } - Rectangle { - id: cancelButton - width: 100 - height: titleBar.height - 7 - color: "black" - anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter } - - Text { - anchors { fill: parent; margins: 4 } - text: "Cancel" - color: "white" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - font.pixelSize: 20 - } - - MouseArea { - anchors.fill: parent - onClicked: fileBrowser.selectFile("") - } - } - ListView { id: view1 anchors.top: titleBar.bottom @@ -280,6 +259,28 @@ Rectangle { Keys.onPressed: root.keyPressed(event.key) } + Rectangle { + id: cancelButton + width: 100 + height: titleBar.height - 7 + color: "black" + anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter } + + Text { + anchors { fill: parent; margins: 4 } + text: "Cancel" + color: "white" + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + font.pixelSize: 20 + } + + MouseArea { + anchors.fill: parent + onClicked: fileBrowser.selectFile("") + } + } + Keys.onPressed: { root.keyPressed(event.key); if (event.key == Qt.Key_Return || event.key == Qt.Key_Select || event.key == Qt.Key_Right) { |