mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-20 02:04:01 -04:00
deprecation notice to plugin compatibility shims - When qml-common became a thing, we left qs.Widgets shims in place for plugin compatibility - It's annoying to need to maintain them when qml-common has any change, add a warning so we can safely deprecate them in the future - One shot rename the common stuff to D to make it shorter and nicer to write
44 lines
1.2 KiB
QML
44 lines
1.2 KiB
QML
pragma ComponentBehavior: Bound
|
|
|
|
import QtQuick
|
|
import Quickshell.Widgets
|
|
import qs.Common
|
|
import qs.DCommon.Widgets
|
|
|
|
Item {
|
|
id: root
|
|
|
|
property string artUrl: ""
|
|
property real placeholderIconSize: Math.min(width, height) * 0.46
|
|
property real cornerRadius: Math.min(width, height) * 0.22
|
|
readonly property real renderScale: Window.window?.devicePixelRatio ?? Screen.devicePixelRatio
|
|
readonly property int artPixelSize: Math.max(1, Math.round(Math.max(width, height) * renderScale))
|
|
|
|
ClippingRectangle {
|
|
anchors.fill: parent
|
|
radius: root.cornerRadius
|
|
color: Theme.primaryContainer
|
|
antialiasing: true
|
|
|
|
DIcon {
|
|
anchors.centerIn: parent
|
|
name: "music_note"
|
|
size: root.placeholderIconSize
|
|
color: Theme.accentOnPrimaryContainer
|
|
visible: artwork.status !== Image.Ready
|
|
}
|
|
|
|
Image {
|
|
id: artwork
|
|
|
|
anchors.fill: parent
|
|
source: root.visible && root.width > 0 ? root.artUrl : ""
|
|
asynchronous: true
|
|
retainWhileLoading: true
|
|
cache: true
|
|
fillMode: Image.PreserveAspectCrop
|
|
sourceSize: Qt.size(root.artPixelSize, root.artPixelSize)
|
|
}
|
|
}
|
|
}
|