From 505629d69a619720ce4f125923d81db7c8510f4d Mon Sep 17 00:00:00 2001 From: Kitteh Date: Sun, 21 Oct 2018 15:42:52 +0100 Subject: [PATCH] [UI] Open Media Changes --- src/qml/main.qml | 70 +++++++++++++++--------------------------------- 1 file changed, 22 insertions(+), 48 deletions(-) diff --git a/src/qml/main.qml b/src/qml/main.qml index 6488249..736d686 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -221,54 +221,30 @@ Window { titleBackground.visible = true } + FileDialog { + id: fileDialog + title: "Please choose a file" + folder: shortcuts.home + onAccepted: { + renderer.command(["loadfile", String(fileDialog.fileUrl)]) + fileDialog.close() + } + onRejected: { + fileDialog.close() + } + } + Dialog { id: loadDialog title: "URL / File Path" - FileDialog { - id: fileDialog - title: "Please choose a file" - folder: shortcuts.home - onAccepted: { - renderer.command(["loadfile", String(fileDialog.fileUrl)]) - loadDialog.close() - } - onRejected: { - fileDialog.close() - } - } - contentItem: Rectangle { - implicitWidth: 150 - implicitHeight: 200 - anchors.fill: parent - TextField { - id: pathText - placeholderText: qsTr("URL / File Path") - } - Button { - id: fileChooserButton - flat: false - anchors.top: pathText.bottom; - text: "File Chooser" - onClicked: fileDialog.open() - } - Button { - flat: false - id: loadOKButton - anchors.top: fileChooserButton.bottom; - text: "OK" - onClicked: { - renderer.command(["loadfile", pathText.text]) - loadDialog.close() - } - } - Button { - flat: false - anchors.top: loadOKButton.bottom; - text: "Cancel" - onClicked: { - loadDialog.close() - } - } + standardButtons: StandardButton.Cancel | StandardButton.Open + onAccepted: { + renderer.command(["loadfile", pathText.text]) + pathText.text = "" + } + TextField { + id: pathText + placeholderText: qsTr("URL / File Path") } } @@ -303,7 +279,7 @@ Window { updateControls() } onDoubleClicked: { - loadDialog.open() + fileDialog.open() } Timer { id: mouseAreaPlayerTimer @@ -727,8 +703,6 @@ Window { color: "transparent" } } - - //} } Item {