123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- import QtQuick 2.15
- import QtGraphicalEffects 1.15
- import DMusic 1.0
- import "components"
- FloatingPanel {
- id: root
- width: 280
- height: 265
- property PopupController ppc
- Item {
- anchors.fill: parent
- RoundedImage {
- id: _icon
- source: (ppc.opened || ppc.running)? PlayingTrackInfo.hqCover : ""
- anchors.left: parent.left
- anchors.top: parent.top
- anchors.leftMargin: 15
- anchors.topMargin: 15
- width: 180
- height: 180
- sourceSize.width: 180
- sourceSize.height: 180
- fillMode: Image.PreserveAspectCrop
- clip: true
- radius: 5
- MouseArea {
- anchors.fill: parent
- enabled: ppc.opened && PlayingTrackInfo.originalUrl.toString().length > 0
- cursorShape: enabled? Qt.PointingHandCursor : Qt.ArrowCursor
- onClicked: Qt.openUrlExternally(PlayingTrackInfo.originalUrl)
- }
- }
- Column {
- id: _buttonsLeft
- width: 20
- anchors.left: _icon.right
- anchors.top: parent.top
- anchors.leftMargin: 15
- anchors.topMargin: 20
- spacing: 18
- PlayerControlsButton {
- icon: PlayingTrackInfo.liked? "qrc:/resources/player/liked.svg" : "qrc:/resources/player/like.svg"
- property bool value: PlayingTrackInfo.liked
- width: 20
- height: 20
- style: value? Style.panel.icon.accent : Style.panel.icon.normal
- onClick: PlayingTrackInfo.liked = !PlayingTrackInfo.liked
- Shortcut {
- sequence: "L"
- context: Qt.ApplicationShortcut
- onActivated: PlayingTrackInfo.liked = !PlayingTrackInfo.liked
- }
- }
- PlayerControlsButton {
- icon: "qrc:/resources/player/dislike.svg"
- property bool value: PlayingTrackInfo.disliked
- width: 20
- height: 20
- style: value? Style.panel.icon.accent : Style.panel.icon.normal
- onClick: PlayingTrackInfo.disliked = !PlayingTrackInfo.disliked
- Shortcut {
- sequence: "Ctrl+L"
- context: Qt.ApplicationShortcut
- onActivated: PlayingTrackInfo.disliked = !PlayingTrackInfo.disliked
- }
- }
- PlayerControlsButton {
- icon: "qrc:/resources/player/share.svg"
- width: 20
- height: 20
- style: Style.panel.icon.normal
- onClick: Clipboard.copyCurrentTrackPicture()
- Shortcut {
- sequence: "Ctrl+C"
- context: Qt.ApplicationShortcut
- onActivated: Clipboard.copyCurrentTrackPicture()
- }
- }
- }
- Column {
- id: _buttonsRight
- width: 20
- anchors.left: _buttonsLeft.right
- anchors.top: parent.top
- anchors.leftMargin: 15
- anchors.topMargin: 20
- spacing: 18
- PlayerControlsButton {
- enabled: PlayingTrackInfo.canStartYandexRadio
- icon: "qrc:/resources/player/radio.svg"
- width: 20
- height: 20
- style: Style.panel.icon.normal
- onClick: AudioPlayer.playRadioFromYmTrack(PlayingTrackInfo.id)
- Shortcut {
- sequence: "Ctrl+R"
- context: Qt.ApplicationShortcut
- onActivated: AudioPlayer.playRadioFromYmTrack(PlayingTrackInfo.id)
- }
- }
- }
- layer.enabled: true
- layer.effect: OpacityMask {
- maskSource: Item {
- width: root.width
- height: root.height
- Rectangle {
- anchors.fill: parent
- radius: Style.panel.sellection.radius
- }
- }
- }
- }
- }
|