From 7d5482c1f6d47bb4c2be31665198459335519fc4 Mon Sep 17 00:00:00 2001 From: Kitteh Date: Tue, 23 Oct 2018 16:45:44 +0100 Subject: [PATCH] [UI] Add settings menu. --- src/qml/main.qml | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/src/qml/main.qml b/src/qml/main.qml index 4824e13..35c3228 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -202,7 +202,7 @@ Window { } function hideControls() { - if (! subtitlesMenu.visible) { + if ( (!subtitlesMenu.visible) || (!settingsMenu.visible) ) { player.setOption("sub-margin-y", "22") controlsBar.visible = false controlsBackground.visible = false @@ -278,9 +278,6 @@ Window { player.command(["cycle", "pause"]) updateControls() } - onDoubleClicked: { - fileDialog.open() - } Timer { id: mouseAreaPlayerTimer interval: 1000 @@ -366,6 +363,38 @@ Window { visible: true color: "transparent" + Rectangle { + id: settingsMenuBackground + anchors.fill: settingsMenu + Layout.fillWidth: true + Layout.fillHeight: true + visible: false + color: "black" + opacity: 0.6 + radius: 5 + } + + Rectangle { + id: settingsMenu + color: "transparent" + width: childrenRect.width + height: childrenRect.height + visible: false + anchors.right: settingsButton.right + anchors.bottom: progressBar.top + radius: 5 + + ColumnLayout { + Button { + text: "Open File" + onClicked: fileDialog.open() + } + Button { + text: "Enter Path" + onClicked: loadDialog.open() + } + } + } Rectangle { id: subtitlesMenuBackground anchors.fill: subtitlesMenu @@ -377,6 +406,7 @@ Window { radius: 5 } + Rectangle { id: subtitlesMenu color: "transparent" @@ -678,7 +708,8 @@ Window { anchors.bottom: parent.bottom display: AbstractButton.IconOnly onClicked: { - loadDialog.open() + settingsMenu.visible = !settingsMenu.visible + settingsMenuBackground.visible = !settingsMenuBackground.visible } background: Rectangle { color: "transparent"