Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Multimedia
Elisa
Commits
86b6dfa6
Commit
86b6dfa6
authored
Aug 19, 2020
by
Jan Blackquill
🌈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make exported global application menu more menubar-y
parent
c75c9e14
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
194 additions
and
9 deletions
+194
-9
src/CMakeLists.txt
src/CMakeLists.txt
+3
-1
src/qml/NativeGlobalMenu.qml
src/qml/NativeGlobalMenu.qml
+164
-0
src/qml/NativeMenuItemFromAction.qml
src/qml/NativeMenuItemFromAction.qml
+20
-0
src/qml/NativeTrayMenu.qml
src/qml/NativeTrayMenu.qml
+1
-2
src/qml/PlatformIntegration.qml
src/qml/PlatformIntegration.qml
+3
-5
src/resources.qrc
src/resources.qrc
+3
-1
No files found.
src/CMakeLists.txt
View file @
86b6dfa6
...
...
@@ -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
...
...
src/qml/NativeGlobalMenu.qml
0 → 100644
View file @
86b6dfa6
/*
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
"
}
}
}
src/qml/NativeMenuItemFromAction.qml
0 → 100644
View file @
86b6dfa6
/*
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
!==
""
}
src/qml/Native
Application
Menu.qml
→
src/qml/Native
Tray
Menu.qml
View file @
86b6dfa6
...
...
@@ -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
{
...
...
src/qml/PlatformIntegration.qml
View file @
86b6dfa6
...
...
@@ -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
:
Native
Application
Menu
{
menu
:
Native
Tray
Menu
{
id
:
exportedMenu
}
...
...
src/resources.qrc
View file @
86b6dfa6
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment