Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Elisa
Commits
2e0d85e1
Commit
2e0d85e1
authored
Mar 07, 2022
by
Tranter Madi
🌧
Browse files
Improve Menu button's code
parent
629443d3
Pipeline
#146425
passed with stage
in 7 minutes and 35 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
src/qml/MediaPlayerControl.qml
View file @
2e0d85e1
...
...
@@ -189,23 +189,22 @@ BasePlayerControl {
text
:
i18nc
(
"
open application menu
"
,
"
Application Menu
"
)
icon.name
:
"
open-menu-symbolic
"
checkable
:
true
checked
:
applicationMenu
.
visible
down
:
applicationMenu
.
visible
onClicked
:
{
if
(
applicationMenu
.
visible
)
{
applicationMenu
.
close
()
}
else
{
var
pos
=
menuButton
.
mapFromItem
(
headerBar
,
headerBar
.
width
-
applicationMenu
.
width
,
headerBar
.
height
)
applicationMenu
.
popup
(
pos
.
x
,
pos
.
y
)
if
(
!
applicationMenu
.
visible
)
{
applicationMenu
.
open
()
}
}
ApplicationMenu
{
id
:
applicationMenu
// otherwise clicking on the menu button will not close it
closePolicy
:
Popup
.
CloseOnEscape
|
Popup
.
CloseOnPressOutsideParent
y
:
menuButton
.
height
// without modal, clicking on menuButton will not close the menu
modal
:
true
dim
:
false
}
}
...
...
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