1
0
Fork 0

[UI] Add settings menu.

This commit is contained in:
Kitteh 2018-10-23 16:45:44 +01:00
parent 8e115d3416
commit 7d5482c1f6

View file

@ -202,7 +202,7 @@ Window {
} }
function hideControls() { function hideControls() {
if (! subtitlesMenu.visible) { if ( (!subtitlesMenu.visible) || (!settingsMenu.visible) ) {
player.setOption("sub-margin-y", "22") player.setOption("sub-margin-y", "22")
controlsBar.visible = false controlsBar.visible = false
controlsBackground.visible = false controlsBackground.visible = false
@ -278,9 +278,6 @@ Window {
player.command(["cycle", "pause"]) player.command(["cycle", "pause"])
updateControls() updateControls()
} }
onDoubleClicked: {
fileDialog.open()
}
Timer { Timer {
id: mouseAreaPlayerTimer id: mouseAreaPlayerTimer
interval: 1000 interval: 1000
@ -366,6 +363,38 @@ Window {
visible: true visible: true
color: "transparent" 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 { Rectangle {
id: subtitlesMenuBackground id: subtitlesMenuBackground
anchors.fill: subtitlesMenu anchors.fill: subtitlesMenu
@ -377,6 +406,7 @@ Window {
radius: 5 radius: 5
} }
Rectangle { Rectangle {
id: subtitlesMenu id: subtitlesMenu
color: "transparent" color: "transparent"
@ -678,7 +708,8 @@ Window {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
display: AbstractButton.IconOnly display: AbstractButton.IconOnly
onClicked: { onClicked: {
loadDialog.open() settingsMenu.visible = !settingsMenu.visible
settingsMenuBackground.visible = !settingsMenuBackground.visible
} }
background: Rectangle { background: Rectangle {
color: "transparent" color: "transparent"