Commit 53aea328 authored by Nate Graham's avatar Nate Graham
Browse files

Make the "Show Playlist" action more obvious, and hide the playlist at small window sizes

See merge request kde/elisa!47

BUG: 392778

FIXED-IN: 20.04.0
parents f5fe92e1 de7c100c
...@@ -30,7 +30,6 @@ Menu { ...@@ -30,7 +30,6 @@ Menu {
property var aboutAppAction: elisa.action("help_about_app") property var aboutAppAction: elisa.action("help_about_app")
property var configureShortcutsAction: elisa.action("options_configure_keybinding") property var configureShortcutsAction: elisa.action("options_configure_keybinding")
property var configureAction: elisa.action("options_configure") property var configureAction: elisa.action("options_configure")
property var togglePlaylistAction: elisa.action("toggle_playlist")
Action { Action {
text: i18nc("Refresh Music Collection application menu entry", "Refresh Music Collection") text: i18nc("Refresh Music Collection application menu entry", "Refresh Music Collection")
...@@ -64,16 +63,6 @@ Menu { ...@@ -64,16 +63,6 @@ Menu {
} }
} }
Action {
shortcut: togglePlaylistAction.shortcut
text: contentView.showPlaylist ? i18nc("Hide playlist", "Hide Playlist") : i18nc("Show playlist", "Show Playlist")
icon.name: "view-media-playlist"
onTriggered: {
contentView.showPlaylist = !contentView.showPlaylist
applicationMenu.close()
}
}
MenuSeparator { MenuSeparator {
visible: reportBugAction.text !== "" visible: reportBugAction.text !== ""
} }
......
...@@ -270,7 +270,7 @@ RowLayout { ...@@ -270,7 +270,7 @@ RowLayout {
states: [ states: [
State { State {
name: "browsingViewsNoPlaylist" name: "browsingViewsNoPlaylist"
when: contentViewContainer.showPlaylist === false when: contentViewContainer.showPlaylist === false || mainWindow.width < elisaTheme.viewSelectorSmallSizeThreshold
PropertyChanges { PropertyChanges {
target: playList target: playList
Layout.minimumWidth: 0 Layout.minimumWidth: 0
...@@ -284,7 +284,7 @@ RowLayout { ...@@ -284,7 +284,7 @@ RowLayout {
}, },
State { State {
name: 'browsingViews' name: 'browsingViews'
when: contentViewContainer.showPlaylist === true when: contentViewContainer.showPlaylist === true || mainWindow.width >= elisaTheme.viewSelectorSmallSizeThreshold
PropertyChanges { PropertyChanges {
target: playList target: playList
Layout.minimumWidth: contentViewContainer.width * 0.28 Layout.minimumWidth: contentViewContainer.width * 0.28
......
...@@ -27,7 +27,7 @@ ApplicationWindow { ...@@ -27,7 +27,7 @@ ApplicationWindow {
visible: true visible: true
minimumWidth: contentView.showPlaylist ? 1100 : 700 minimumWidth: 700
minimumHeight: 600 minimumHeight: 600
LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
......
...@@ -412,6 +412,29 @@ FocusScope { ...@@ -412,6 +412,29 @@ FocusScope {
icon.height: elisaTheme.smallControlButtonSize icon.height: elisaTheme.smallControlButtonSize
} }
// Not a FlatButtonWithToolTip because we want text
Button {
id: showHidePlaylistAction
action: Action {
shortcut: elisa.action("toggle_playlist").shortcut
onTriggered: contentView.showPlaylist = !contentView.showPlaylist
}
visible: mainWindow.width >= elisaTheme.viewSelectorSmallSizeThreshold
flat: true
text: i18n("Show Playlist")
icon.name: "view-media-playlist"
checkable: true
checked: contentView.showPlaylist
activeFocusOnTab: true
Keys.onReturnPressed: action.trigger()
Accessible.onPressAction: action.trigger()
}
FlatButtonWithToolTip { FlatButtonWithToolTip {
id: menuButton id: menuButton
action: applicationMenuAction action: applicationMenuAction
...@@ -419,9 +442,6 @@ FocusScope { ...@@ -419,9 +442,6 @@ FocusScope {
icon.width: elisaTheme.smallControlButtonSize icon.width: elisaTheme.smallControlButtonSize
icon.height: elisaTheme.smallControlButtonSize icon.height: elisaTheme.smallControlButtonSize
Layout.rightMargin: !LayoutMirroring.enabled ? elisaTheme.mediaPlayerHorizontalMargin : elisaTheme.mediaPlayerHorizontalMargin * 1.5
Layout.leftMargin: LayoutMirroring.enabled ? elisaTheme.mediaPlayerHorizontalMargin : elisaTheme.mediaPlayerHorizontalMargin * 1.5
} }
} }
......
...@@ -60,8 +60,10 @@ Menu { ...@@ -60,8 +60,10 @@ Menu {
MenuItem { MenuItem {
shortcut: togglePlaylistAction.shortcut shortcut: togglePlaylistAction.shortcut
text: contentView.showPlaylist ? i18nc("Hide playlist", "Hide Playlist") : i18nc("Show playlist", "Show Playlist") text: i18n("Show Playlist")
iconName: "view-media-playlist" iconName: "view-media-playlist"
checkable: true
checked: contentView.showPlaylist
onTriggered: contentView.showPlaylist = !contentView.showPlaylist onTriggered: contentView.showPlaylist = !contentView.showPlaylist
enabled: contentView.currentViewIndex != 0 enabled: contentView.currentViewIndex != 0
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment