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
40734301
Commit
40734301
authored
Feb 26, 2022
by
Devin Lin
🎨
Committed by
Nate Graham
Feb 28, 2022
Browse files
Port to Kirigami.Dialog
parent
a2ecfd86
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/qml/GridBrowserDelegate.qml
View file @
40734301
...
...
@@ -11,7 +11,7 @@ import QtQuick.Window 2.2
import
QtQml
.
Models
2.1
import
QtQuick
.
Layouts
1.2
import
QtGraphicalEffects
1.0
import
org
.
kde
.
kirigami
2.
5
as
Kirigami
import
org
.
kde
.
kirigami
2.
19
as
Kirigami
import
org
.
kde
.
elisa
1.0
import
"
mobile
"
...
...
@@ -391,42 +391,38 @@ FocusScope {
id
:
contextMenuLoader
active
:
false
sourceComponent
:
MobileContextMenuSheet
{
sourceComponent
:
Kirigami.MenuDialog
{
id
:
contextMenu
title
:
gridEntry
.
mainText
preferredWidth
:
Kirigami
.
Units
.
gridUnit
*
20
ColumnLayout
{
Layout.preferredWidth
:
Kirigami
.
Units
.
gridUnit
*
20
spacing
:
0
MobileContextMenuEntry
{
onClicked
:
{
actions
:
[
Kirigami.Action
{
onTriggered
:
{
replaceAndPlay
();
contextMenu
.
close
();
}
icon
:
"
media-playback-start
"
icon
Name
:
"
media-playback-start
"
text
:
i18nc
(
"
Clear play list and add whole container to play list
"
,
"
Play now, replacing current queue
"
)
}
MobileContextMenuEntry
{
},
Kirigami.Action
{
visible
:
fileUrl
.
toString
().
substring
(
0
,
7
)
===
'
file://
'
on
Click
ed
:
{
on
Trigger
ed
:
{
ElisaApplication
.
showInFolder
(
gridEntry
.
fileUrl
)
contextMenu
.
close
();
}
icon
:
"
document-open-folder
"
icon
Name
:
"
document-open-folder
"
text
:
i18nc
(
"
Show the file for this song in the file manager
"
,
"
Show in folder
"
)
}
MobileContextMenuEntry
{
onClicked
:
{
},
Kirigami.Action
{
onTriggered
:
{
enqueue
();
contextMenu
.
close
();
}
icon
:
"
list-add
"
icon
Name
:
"
list-add
"
text
:
i18nc
(
"
Add whole container to play list
"
,
"
Add to queue
"
)
}
}
]
}
}
}
src/qml/ListBrowserDelegate.qml
View file @
40734301
...
...
@@ -11,7 +11,7 @@ import QtQuick.Layouts 1.2
import
QtQuick
.
Controls
2.3
import
QtQuick
.
Window
2.2
import
QtGraphicalEffects
1.0
import
org
.
kde
.
kirigami
2.
5
as
Kirigami
import
org
.
kde
.
kirigami
2.
19
as
Kirigami
import
org
.
kde
.
elisa
1.0
import
"
mobile
"
...
...
@@ -374,36 +374,32 @@ FocusScope {
active
:
false
// context menu sheet
sourceComponent
:
MobileContextMenuSheet
{
sourceComponent
:
Kirigami.MenuDialog
{
id
:
contextMenu
title
:
mediaTrack
.
title
preferredWidth
:
Kirigami
.
Units
.
gridUnit
*
20
ColumnLayout
{
Layout.preferredWidth
:
Kirigami
.
Units
.
gridUnit
*
20
spacing
:
0
MobileContextMenuEntry
{
actions
:
[
Kirigami.Action
{
visible
:
trackUrl
.
toString
().
substring
(
0
,
7
)
===
'
file://
'
on
Click
ed
:
{
on
Trigger
ed
:
{
ElisaApplication
.
showInFolder
(
mediaTrack
.
trackUrl
);
contextMenu
.
close
();
}
icon
:
"
document-open-folder
"
icon
Name
:
"
document-open-folder
"
text
:
i18nc
(
"
Show the file for this song in the file manager
"
,
"
Show in folder
"
)
}
MobileContextMenuEntry
{
onClicked
:
{
},
Kirigami.Action
{
onTriggered
:
{
callOpenMetaDataView
(
trackUrl
,
dataType
);
contextMenu
.
close
();
}
icon
:
"
documentinfo
"
icon
Name
:
"
documentinfo
"
text
:
i18nc
(
"
Show track metadata
"
,
"
View details
"
)
}
MobileContextMenuEntry
{
},
Kirigami.Action
{
visible
:
ElisaApplication
.
useFavoriteStyleRatings
on
Click
ed
:
{
on
Trigger
ed
:
{
var
newRating
=
0
;
if
(
rating
==
10
)
{
newRating
=
0
;
...
...
@@ -412,31 +408,18 @@ FocusScope {
}
contextMenu
.
close
();
}
icon
:
rating
==
10
?
"
rating-unrated
"
:
"
rating
"
icon
Name
:
rating
==
10
?
"
rating-unrated
"
:
"
rating
"
text
:
rating
==
10
?
i18n
(
"
Mark this song as no longer being a favorite
"
,
"
Un-mark as favorite
"
)
:
i18n
(
"
Mark this song as a favorite
"
,
"
Mark as favorite
"
)
}
MobileContextMenuEntry
{
onClicked
:
{
},
Kirigami.Action
{
onTriggered
:
{
enqueue
();
contextMenu
.
close
();
}
icon
:
"
list-add
"
icon
Name
:
"
list-add
"
text
:
i18nc
(
"
Enqueue current track
"
,
"
Add to queue
"
)
}
RatingStar
{
id
:
ratingWidgetMobile
visible
:
!
ElisaApplication
.
useFavoriteStyleRatings
starRating
:
rating
Layout.alignment
:
Qt
.
AlignHCenter
Layout.leftMargin
:
Kirigami
.
Units
.
largeSpacing
Layout.rightMargin
:
Kirigami
.
Units
.
largeSpacing
}
}
]
}
}
...
...
src/qml/MediaTrackMetadataForm.qml
View file @
40734301
...
...
@@ -69,7 +69,7 @@ Kirigami.FormLayout {
model
:
metadataModel
delegate
:
RowLayout
{
Kirigami.FormData.label
:
"
<b>
"
+
model
.
name
+
"
:
</b>
"
Kirigami.FormData.label
:
model
.
name
+
"
:
"
MediaTrackMetadataDelegate
{
index
:
model
.
index
...
...
src/qml/mobile/MobileContextMenuEntry.qml
deleted
100644 → 0
View file @
a2ecfd86
/*
SPDX-FileCopyrightText: 2021 (c) Devin Lin <espidev@gmail.com>
SPDX-License-Identifier: LGPL-3.0-or-later
*/
import
QtQuick
2.15
import
QtQuick
.
Layouts
1.2
import
QtQuick
.
Controls
2.3
import
QtQuick
.
Window
2.2
import
QtGraphicalEffects
1.0
import
org
.
kde
.
kirigami
2.5
as
Kirigami
import
org
.
kde
.
elisa
1.0
Kirigami.BasicListItem
{
Layout.fillWidth
:
true
Layout.preferredHeight
:
Kirigami
.
Units
.
gridUnit
*
2
iconSize
:
Kirigami
.
Units
.
gridUnit
leftPadding
:
Kirigami
.
Units
.
smallSpacing
rightPadding
:
0
}
src/qml/mobile/MobileContextMenuSheet.qml
deleted
100644 → 0
View file @
a2ecfd86
/*
SPDX-FileCopyrightText: 2020 (c) Devin Lin <espidev@gmail.com>
SPDX-License-Identifier: LGPL-3.0-or-later
*/
import
QtQuick
2.7
import
QtQuick
.
Layouts
1.2
import
QtQuick
.
Controls
2.3
import
org
.
kde
.
kirigami
2.13
as
Kirigami
Kirigami.OverlaySheet
{
id
:
contextMenu
property
alias
title
:
heading
.
text
leftPadding
:
Kirigami
.
Units
.
smallSpacing
rightPadding
:
Kirigami
.
Units
.
smallSpacing
header
:
Kirigami.Heading
{
id
:
heading
level
:
2
wrapMode
:
Text
.
Wrap
}
footer
:
RowLayout
{
Button
{
Layout.alignment
:
Qt
.
AlignRight
text
:
i18n
(
"
Close
"
)
icon.name
:
"
dialog-close
"
onClicked
:
contextMenu
.
close
()
}
}
}
src/qml/mobile/MobilePlayListDelegate.qml
View file @
40734301
...
...
@@ -9,7 +9,7 @@ import QtQuick.Layouts 1.2
import
QtQuick
.
Controls
2.3
import
QtQuick
.
Window
2.2
import
QtGraphicalEffects
1.0
import
org
.
kde
.
kirigami
2.1
3
as
Kirigami
import
org
.
kde
.
kirigami
2.1
9
as
Kirigami
import
org
.
kde
.
elisa
1.0
import
"
..
"
...
...
@@ -152,26 +152,27 @@ BasePlayListDelegate {
active
:
false
// context menu sheet
sourceComponent
:
MobileContextMenuSheet
{
sourceComponent
:
Kirigami.MenuDialog
{
id
:
contextMenu
title
:
playListEntry
.
title
ColumnLayout
{
Layout.preferredWidth
:
Kirigami
.
Units
.
gridUnit
*
20
spacing
:
0
MobileContextMenuEntry
{
preferredWidth
:
Kirigami
.
Units
.
gridUnit
*
20
actions
:
[
Kirigami.Action
{
visible
:
playListEntry
.
fileName
.
toString
().
substring
(
0
,
7
)
===
'
file://
'
onClicked
:
{
iconName
:
"
document-open-folder
"
text
:
i18nc
(
"
Show the file for this song in the file manager
"
,
"
Show in folder
"
)
onTriggered
:
{
ElisaApplication
.
showInFolder
(
playListEntry
.
fileName
)
contextMenu
.
close
();
}
icon
:
"
document-open-folder
"
text
:
i18nc
(
"
Show the file for this song in the file manager
"
,
"
Show in folder
"
)
}
MobileContextMenuEntry
{
},
Kirigami.Action
{
visible
:
isValid
onClicked
:
{
iconName
:
"
documentinfo
"
text
:
i18nc
(
"
Show track metadata
"
,
"
View details
"
)
onTriggered
:
{
if
(
metadataLoader
.
active
===
false
)
{
metadataLoader
.
active
=
true
}
...
...
@@ -181,20 +182,17 @@ BasePlayListDelegate {
}
contextMenu
.
close
();
}
icon
:
"
documentinfo
"
text
:
i18nc
(
"
Show track metadata
"
,
"
View details
"
)
}
MobileContextMenuEntry
{
},
Kirigami.Action
{
visible
:
isValid
onClicked
:
{
iconName
:
"
error
"
text
:
i18nc
(
"
Remove current track from play list
"
,
"
Remove from queue
"
)
onTriggered
:
{
playListEntry
.
removeFromPlaylist
(
playListEntry
.
index
)
contextMenu
.
close
();
}
icon
:
"
error
"
text
:
i18nc
(
"
Remove current track from play list
"
,
"
Remove from queue
"
)
}
}
]
}
}
}
...
...
src/resources.qrc
View file @
40734301
...
...
@@ -51,9 +51,7 @@
<file>qml/mobile/MobileSettingsPage.qml</file>
<file>qml/mobile/MobileMediaTrackMetadataView.qml</file>
<file>qml/mobile/MobilePlayListDelegate.qml</file>
<file>qml/mobile/MobileContextMenuSheet.qml</file>
<file>qml/mobile/MobileVolumeButton.qml</file>
<file>qml/mobile/MobileContextMenuEntry.qml</file>
<file>qml/shared/BasePlayerControl.qml</file>
<file>qml/shared/BasePlayListDelegate.qml</file>
</qresource>
...
...
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