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 {
property var aboutAppAction: elisa.action("help_about_app")
property var configureShortcutsAction: elisa.action("options_configure_keybinding")
property var configureAction: elisa.action("options_configure")
property var togglePlaylistAction: elisa.action("toggle_playlist")
Action {
text: i18nc("Refresh Music Collection application menu entry", "Refresh Music Collection")
......@@ -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 {
visible: reportBugAction.text !== ""
}
......
......@@ -270,7 +270,7 @@ RowLayout {
states: [
State {
name: "browsingViewsNoPlaylist"
when: contentViewContainer.showPlaylist === false
when: contentViewContainer.showPlaylist === false || mainWindow.width < elisaTheme.viewSelectorSmallSizeThreshold
PropertyChanges {
target: playList
Layout.minimumWidth: 0
......@@ -284,7 +284,7 @@ RowLayout {
},
State {
name: 'browsingViews'
when: contentViewContainer.showPlaylist === true
when: contentViewContainer.showPlaylist === true || mainWindow.width >= elisaTheme.viewSelectorSmallSizeThreshold
PropertyChanges {
target: playList
Layout.minimumWidth: contentViewContainer.width * 0.28
......
......@@ -27,7 +27,7 @@ ApplicationWindow {
visible: true
minimumWidth: contentView.showPlaylist ? 1100 : 700
minimumWidth: 700
minimumHeight: 600
LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
......
......@@ -412,6 +412,29 @@ FocusScope {
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 {
id: menuButton
action: applicationMenuAction
......@@ -419,9 +442,6 @@ FocusScope {
icon.width: 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 {
MenuItem {
shortcut: togglePlaylistAction.shortcut
text: contentView.showPlaylist ? i18nc("Hide playlist", "Hide Playlist") : i18nc("Show playlist", "Show Playlist")
text: i18n("Show Playlist")
iconName: "view-media-playlist"
checkable: true
checked: contentView.showPlaylist
onTriggered: contentView.showPlaylist = !contentView.showPlaylist
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