Commit 86b6dfa6 authored by Jan Blackquill's avatar Jan Blackquill 🌈
Browse files

Make exported global application menu more menubar-y

parent c75c9e14
......@@ -377,7 +377,9 @@ if (Qt5Quick_FOUND AND Qt5Widgets_FOUND)
qml/ElisaMainWindow.qml
qml/ApplicationMenu.qml
qml/NativeApplicationMenu.qml
qml/NativeGlobalMenu.qml
qml/NativeTrayMenu.qml
qml/NativeMenuItemFromAction.qml
qml/BaseTheme.qml
qml/Theme.qml
qml/PlatformIntegration.qml
......
/*
SPDX-FileCopyrightText: 2020 Carson Black <uhhadd@gmail.com>
SPDX-License-Identifier: LGPL-3.0-or-later
*/
import QtQuick 2.7
import QtQuick.Window 2.7
import Qt.labs.platform 1.1
import org.kde.elisa 1.0
MenuBar {
Menu {
title: i18nc("menu category", "File")
MenuItem {
text: i18nc("menu entry", "Save Playlist...")
iconName: "document-save"
onTriggered: ElisaApplication.musicManager.resetMusicData()
}
MenuItem {
text: i18nc("menu entry", "Open Playlist...")
iconName: "document-open"
onTriggered: ElisaApplication.musicManager.resetMusicData()
}
MenuItem {
text: i18nc("Refresh Music Collection application menu entry", "Refresh Music Collection")
iconName: "view-refresh"
onTriggered: ElisaApplication.musicManager.resetMusicData()
}
MenuSeparator {
}
NativeMenuItemFromAction {
elisaAction: "options_configure"
}
MenuSeparator {
}
NativeMenuItemFromAction {
elisaAction: "file_quit"
}
}
Menu {
title: i18nc("menu category", "View")
MenuItem {
text: headerBar.isMaximized ? i18nc("menu entry", "Collapse Player") : i18nc("menu entry", "Expand Player")
iconName: headerBar.isMaximized ? "arrow-up" : "expand"
onTriggered: headerBar.isMaximized = !headerBar.isMaximized
}
MenuItem {
text: mainWindow.visibility == Window.FullScreen ? i18nc("menu entry", "Leave Fullscreen") : i18nc("menu entry", "Enter Fullscreen")
iconName: "view-fullscreen"
onTriggered: mainWindow.visibility == Window.FullScreen ? mainWindow.showNormal() : mainWindow.showFullScreen()
}
MenuItem {
text: contentView.showPlaylist ? i18n("Hide Playlist") : i18n("Show Playlist")
iconName: contentView.showPlaylist ? "show-menu" : "view-media-playlist"
onTriggered: contentView.showPlaylist = !contentView.showPlaylist
}
}
Menu {
title: i18nc("menu category", "Controls")
MenuItem {
text: ElisaApplication.audioControl.playerPlaybackState == 1 ? i18n("Pause") : i18n("Play")
iconName: ElisaApplication.audioControl.playerPlaybackState == 1 ? "media-playback-pause" : "media-playback-start"
onTriggered: ElisaApplication.audioControl.playPause()
}
MenuItem {
enabled: ElisaApplication.audioControl.playerPlaybackState != 0
text: i18n("Stop")
iconName: "media-playback-stop"
onTriggered: ElisaApplication.audioControl.stop()
}
MenuSeparator {
}
MenuItem {
text: i18n("Increase Volume")
enabled: ElisaApplication.audioPlayer.volume < 100.0
onTriggered: ElisaApplication.audioPlayer.setVolume(ElisaApplication.audioPlayer.volume + 5)
}
MenuItem {
text: i18n("Decrease Volume")
enabled: ElisaApplication.audioPlayer.volume > 100.0
onTriggered: ElisaApplication.audioPlayer.setVolume(ElisaApplication.audioPlayer.volume - 5)
}
MenuSeparator {
}
Menu {
id: shuffleMenu
title: i18n("Shuffle")
MenuItemGroup {
items: shuffleMenu.items
}
MenuItem {
text: i18n("On")
checkable: true
checked: ElisaApplication.mediaPlayListProxyModel.shufflePlayList
onTriggered: ElisaApplication.mediaPlayListProxyModel.shufflePlayList = true
}
MenuItem {
text: i18n("Off")
checkable: true
checked: !ElisaApplication.mediaPlayListProxyModel.shufflePlayList
onTriggered: ElisaApplication.mediaPlayListProxyModel.shufflePlayList = false
}
}
Menu {
id: repeatMenu
title: i18n("Repeat")
MenuItemGroup {
items: repeatMenu.items
}
MenuItem {
text: i18n("On")
checkable: true
checked: ElisaApplication.mediaPlayListProxyModel.repeatPlay
onTriggered: ElisaApplication.mediaPlayListProxyModel.repeatPlay = true
}
MenuItem {
text: i18n("Off")
checkable: true
checked: !ElisaApplication.mediaPlayListProxyModel.repeatPlay
onTriggered: ElisaApplication.mediaPlayListProxyModel.repeatPlay = false
}
}
}
Menu {
title: i18nc("menu category", "Help")
NativeMenuItemFromAction {
elisaAction: "help_contents"
}
MenuSeparator {
}
NativeMenuItemFromAction {
elisaAction: "help_about_app"
}
NativeMenuItemFromAction {
elisaAction: "help_report_bug"
}
}
}
/*
SPDX-FileCopyrightText: 2020 (c) Carson Black <uhhadd@gmail.com>
SPDX-License-Identifier: LGPL-3.0-or-later
*/
import QtQuick 2.7
import Qt.labs.platform 1.1
import org.kde.elisa 1.0
MenuItem {
property string elisaAction: ""
property var __action: ElisaApplication.action(elisaAction)
text: __action.text
shortcut: __action.shortcut
iconName: ElisaApplication.iconName(__action.icon)
onTriggered: __action.trigger()
visible: __action.text !== ""
}
......@@ -6,8 +6,7 @@
*/
import QtQuick 2.7
//explore menu from Qt 5.10 once we can require it, but it is item-based
import Qt.labs.platform 1.0
import Qt.labs.platform 1.1
import org.kde.elisa 1.0
Menu {
......
......@@ -42,10 +42,8 @@ Item {
}
}
NativeMenu.MenuBar {
NativeApplicationMenu {
id: globalMenu
}
NativeGlobalMenu {
id: globalMenu
}
Mpris2 {
......@@ -66,7 +64,7 @@ Item {
tooltip: mainWindow.title
visible: available && showSystemTrayIcon && !mainWindow.visible
menu: NativeApplicationMenu {
menu: NativeTrayMenu {
id: exportedMenu
}
......
......@@ -37,7 +37,9 @@
<file>qml/ViewSelectorDelegate.qml</file>
<file>qml/HeaderFooterToolbar.qml</file>
<file>qml/TracksDiscHeader.qml</file>
<file>qml/NativeApplicationMenu.qml</file>
<file>qml/NativeMenuItemFromAction.qml</file>
<file>qml/NativeTrayMenu.qml</file>
<file>qml/NativeGlobalMenu.qml</file>
<file>qml/ElisaConfigurationDialog.qml</file>
<file>qml/FileScanningConfiguration.qml</file>
<file>qml/GeneralConfiguration.qml</file>
......
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