Commit 46da3cf7 authored by Dmitry Kolesnikov's avatar Dmitry Kolesnikov Committed by Nate Graham
Browse files

Feature: You can put scores 0-5 on central panel

Previously, it was possible to view and change grades in the 0-5 mode
on the central panel, but not to set new ones. Now there is such the
function.
parent febd970e
......@@ -34,6 +34,7 @@ FocusScope {
property bool isSelected
property bool isAlternateColor
property bool detailedView: true
property bool editingRating: false
signal clicked()
signal enqueue()
......@@ -238,7 +239,7 @@ FocusScope {
// hover actions (for desktop)
Loader {
id: hoverLoader
active: !Kirigami.Settings.isMobile && (hoverArea.containsMouse || mediaTrack.activeFocus)
active: !Kirigami.Settings.isMobile && (hoverArea.containsMouse || mediaTrack.activeFocus) && !mediaTrack.editingRating
visible: active
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
......@@ -292,6 +293,21 @@ FocusScope {
onClicked: replaceAndPlay()
}
FlatButtonWithToolTip {
id: ratingButton
visible: !ElisaApplication.useFavoriteStyleRatings
width: singleLineHeight
height: singleLineHeight
text: i18nc("@action:button", "Set track rating")
icon.name: "view-media-favorite"
onClicked: {
mediaTrack.editingRating = true;
}
}
FlatButtonWithToolTip {
visible: ElisaApplication.useFavoriteStyleRatings
......@@ -319,9 +335,30 @@ FocusScope {
}
// ratings (desktop)
Loader {
id: cancelRatingLoader
active: !Kirigami.Settings.isMobile && (hoverArea.containsMouse || mediaTrack.activeFocus)
visible: active && mediaTrack.editingRating
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
z: 1
sourceComponent: Row {
anchors.centerIn: parent
FlatButtonWithToolTip {
width: singleLineHeight
height: singleLineHeight
text: i18nc("@action:button", "Cancel rating this track")
icon.name: "dialog-cancel"
onClicked: { mediaTrack.editingRating = false; }
}
}
}
RatingStar {
id: ratingWidget
visible: !Kirigami.Settings.isMobile && !ElisaApplication.useFavoriteStyleRatings && rating > 0
visible: !Kirigami.Settings.isMobile && (mediaTrack.editingRating || (rating > 0 && !hoverArea.containsMouse && !mediaTrack.activeFocus && !ElisaApplication.useFavoriteStyleRatings))
readOnly: false
starRating: rating
......@@ -329,6 +366,7 @@ FocusScope {
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
onRatingEdited: {
mediaTrack.editingRating = false
trackRatingChanged(trackUrl, starRating);
}
}
......
Supports Markdown
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