diff --git a/src/qml/ApplicationMenu.qml b/src/qml/ApplicationMenu.qml --- a/src/qml/ApplicationMenu.qml +++ b/src/qml/ApplicationMenu.qml @@ -1,7 +1,7 @@ /* * Copyright 2016-2018 Matthieu Gallien * Copyright 2018 Alexander Stippich - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either @@ -21,6 +21,7 @@ import QtQuick 2.7 //explore menu from Qt 5.10 once we can require it, but it is item-based import QtQuick.Controls 1.4 +import org.kde.elisa 1.0 Menu { id: applicationMenu @@ -33,6 +34,13 @@ property var configureShortcutsAction: elisa.action("options_configure_keybinding") property var configureAction: elisa.action("options_configure") + Action { + id: togglePlaylistAction + text: i18nc("Toggle playlist", "Toggle Playlist") + iconName: "view-media-playlist" + onTriggered: contentView.showPlaylist = !contentView.showPlaylist + } + MenuItem { text: configureAction.text shortcut: configureAction.shortcut @@ -49,6 +57,8 @@ visible: configureShortcutsAction.text !== "" } + MenuItem { action: togglePlaylistAction } + MenuSeparator { visible: reportBugAction.text !== "" } diff --git a/src/qml/ContentView.qml b/src/qml/ContentView.qml --- a/src/qml/ContentView.qml +++ b/src/qml/ContentView.qml @@ -27,6 +27,8 @@ id: contentViewContainer spacing: 0 + property bool showPlaylist + signal toggleSearch() function goBack() { @@ -679,6 +681,24 @@ } }, State { + name: "browsingViewsNoPlaylist" + when: listViews.currentIndex !== 0 && contentViewContainer.showPlaylist !== true + extend: "browsingViews" + PropertyChanges { + target: mainContentView + Layout.fillWidth: true + Layout.minimumWidth: contentZone.width + Layout.maximumWidth: contentZone.width + Layout.preferredWidth: contentZone.width + } + PropertyChanges { + target: playList + Layout.minimumWidth: 0 + Layout.maximumWidth: 0 + Layout.preferredWidth: 0 + } + }, + State { name: 'browsingViews' when: listViews.currentIndex !== 0 PropertyChanges { diff --git a/src/qml/ElisaMainWindow.qml b/src/qml/ElisaMainWindow.qml --- a/src/qml/ElisaMainWindow.qml +++ b/src/qml/ElisaMainWindow.qml @@ -102,6 +102,7 @@ property bool expandedFilterView: false + property bool showPlaylist: true } Connections { @@ -121,6 +122,7 @@ persistentSettings.playControlItemRepeat = headerBar.playerControl.repeat persistentSettings.playControlItemShuffle = headerBar.playerControl.shuffle + persistentSettings.showPlaylist = contentView.showPlaylist } } @@ -258,6 +260,7 @@ id: contentView Layout.fillHeight: true Layout.fillWidth: true + showPlaylist: persistentSettings.showPlaylist } } }