mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-06 05:28:29 -04:00
7e0af52d5b
(cherry picked from commit 7cb97f4462)
35 lines
1020 B
QML
35 lines
1020 B
QML
import QtQuick
|
|
import Quickshell.Widgets
|
|
import qs.Common
|
|
|
|
Item {
|
|
id: root
|
|
|
|
property string source: ""
|
|
property int glyphSize: 14
|
|
property bool badgeVisible: true
|
|
|
|
readonly property var sourceAsset: ({
|
|
"flatpak": "../../assets/package-sources/flatpak.svg",
|
|
"snap": "../../assets/package-sources/snap.svg",
|
|
"appimage": "../../assets/package-sources/appimage.svg",
|
|
"nix": "../../assets/package-sources/nix.svg"
|
|
})
|
|
|
|
readonly property string assetPath: sourceAsset[source] || ""
|
|
|
|
visible: badgeVisible && SettingsData.dankLauncherV2ShowSourceBadges && assetPath.length > 0
|
|
implicitWidth: glyphSize
|
|
implicitHeight: glyphSize
|
|
|
|
IconImage {
|
|
anchors.fill: parent
|
|
source: root.assetPath ? Qt.resolvedUrl(root.assetPath) : ""
|
|
implicitSize: root.glyphSize * 2
|
|
backer.sourceSize: Qt.size(root.glyphSize * 2, root.glyphSize * 2)
|
|
smooth: true
|
|
mipmap: true
|
|
asynchronous: true
|
|
}
|
|
}
|