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

Change the order of track control buttons

If the user wants to remove a track from favorites, then he move the
mouse to the rating star, but at the last moment it changes to the
Play button or the Remove button (Depending on the panel). After
clicking on these buttons, not what the user wanted happens.

Kirigami.icon was replaced with a button due to the fact that the
alignment of the control buttons and this icon does not coincide
horizontally, which causes movements.
parent 6ac811c5
......@@ -271,6 +271,27 @@ FocusScope {
onClicked: callOpenMetaDataView(trackUrl, dataType)
}
FlatButtonWithToolTip {
id: enqueueButton
width: singleLineHeight
height: singleLineHeight
text: i18nc("@action:button", "Add to playlist")
icon.name: "list-add"
onClicked: enqueue()
}
FlatButtonWithToolTip {
id: clearAndEnqueueButton
scale: LayoutMirroring.enabled ? -1 : 1
width: singleLineHeight
height: singleLineHeight
text: i18nc("@action:button", "Play now, replacing current playlist")
icon.name: "media-playback-start"
onClicked: replaceAndPlay()
}
FlatButtonWithToolTip {
visible: ElisaApplication.useFavoriteStyleRatings
......@@ -294,27 +315,6 @@ FocusScope {
trackRatingChanged(trackUrl, newRating);
}
}
FlatButtonWithToolTip {
id: enqueueButton
width: singleLineHeight
height: singleLineHeight
text: i18nc("@action:button", "Add to playlist")
icon.name: "list-add"
onClicked: enqueue()
}
FlatButtonWithToolTip {
id: clearAndEnqueueButton
scale: LayoutMirroring.enabled ? -1 : 1
width: singleLineHeight
height: singleLineHeight
text: i18nc("@action:button", "Play now, replacing current playlist")
icon.name: "media-playback-start"
onClicked: replaceAndPlay()
}
}
}
......@@ -332,13 +332,18 @@ FocusScope {
trackRatingChanged(trackUrl, starRating);
}
}
Kirigami.Icon {
visible: !Kirigami.Settings.isMobile && ElisaApplication.useFavoriteStyleRatings && !hoverLoader.active && rating == 10
Loader {
id: favoriteMark
implicitWidth: Kirigami.Units.iconSizes.smallMedium
implicitHeight: Kirigami.Units.iconSizes.smallMedium
visible: !Kirigami.Settings.isMobile && ElisaApplication.useFavoriteStyleRatings && !hoverLoader.active && rating == 10
source: "rating"
sourceComponent: Row {
FlatButtonWithToolTip {
width: singleLineHeight
height: singleLineHeight
icon.name: rating == 10 ? "rating" : "rating-unrated"
}
}
}
LabelWithToolTip {
......
......@@ -274,7 +274,7 @@ BasePlayListDelegate {
enabled: isValid
visible: playListEntry.wideMode && playListEntry.fileName.toString().substring(0, 7) === 'file://'
action: actionList.locateFileAction
KeyNavigation.left: removeButton
KeyNavigation.left: favoriteButton
KeyNavigation.right: infoButton
activeFocusOnTab: isSelected
}
......@@ -285,26 +285,6 @@ BasePlayListDelegate {
enabled: isValid
visible: playListEntry.wideMode
action: actionList.infoAction
KeyNavigation.right: ratingButton
activeFocusOnTab: isSelected
}
FlatButtonWithToolTip {
id: ratingButton
objectName: 'ratingButton'
visible: playListEntry.wideMode && !ElisaApplication.useFavoriteStyleRatings
enabled: isValid
action: actionList.ratingAction
KeyNavigation.right: favoriteButton
activeFocusOnTab: isSelected
}
FlatButtonWithToolTip {
id: favoriteButton
objectName: 'favoriteButton'
visible: playListEntry.wideMode && ElisaApplication.useFavoriteStyleRatings
enabled: isValid
action: actionList.favoriteAction
KeyNavigation.right: playPauseButton
activeFocusOnTab: isSelected
}
......@@ -325,6 +305,26 @@ BasePlayListDelegate {
objectName: 'removeButton'
visible: playListEntry.wideMode
action: actionList.removeAction
KeyNavigation.right: ratingButton
activeFocusOnTab: isSelected
}
FlatButtonWithToolTip {
id: ratingButton
objectName: 'ratingButton'
visible: playListEntry.wideMode && !ElisaApplication.useFavoriteStyleRatings
enabled: isValid
action: actionList.ratingAction
KeyNavigation.right: favoriteButton
activeFocusOnTab: isSelected
}
FlatButtonWithToolTip {
id: favoriteButton
objectName: 'favoriteButton'
visible: playListEntry.wideMode && ElisaApplication.useFavoriteStyleRatings
enabled: isValid
action: actionList.favoriteAction
KeyNavigation.right: locateFileButton
activeFocusOnTab: isSelected
}
......@@ -352,15 +352,21 @@ BasePlayListDelegate {
}
}
Kirigami.Icon {
visible: rating == 10 && !containsMouse && !playListEntry.hasActiveFocus && !simpleMode && ElisaApplication.useFavoriteStyleRatings
Loader {
id: favoriteMark
implicitWidth: Kirigami.Units.iconSizes.smallMedium
implicitHeight: Kirigami.Units.iconSizes.smallMedium
visible: rating == 10 && !containsMouse && !playListEntry.hasActiveFocus && !simpleMode && ElisaApplication.useFavoriteStyleRatings
source: "rating"
sourceComponent: Row {
FlatButtonWithToolTip {
visible: playListEntry.wideMode && ElisaApplication.useFavoriteStyleRatings
enabled: isValid
action: actionList.favoriteAction
}
}
}
LabelWithToolTip {
id: durationLabel
text: duration
......
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