1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-07 14:08:29 -04:00

Squashed commit of the following:

commit 990d86d481
Author: bbedward <bbedward@gmail.com>
Date:   Sat Jul 18 10:43:22 2026 -0400

    flake: update-common

commit 526cb157fd
Author: bbedward <bbedward@gmail.com>
Date:   Thu Jul 16 17:56:40 2026 -0400

    i18n: update sync scrirpt for dank-qml-common

commit 92ba96d9f9
Author: bbedward <bbedward@gmail.com>
Date:   Thu Jul 16 09:24:37 2026 -0400

    qs: integrate with dank-qml-common
This commit is contained in:
bbedward
2026-07-18 10:44:31 -04:00
parent 5dfd875b9e
commit 235f0668b8
128 changed files with 577 additions and 14706 deletions
+2 -80
View File
@@ -1,81 +1,3 @@
import QtQuick
import QtQuick.Effects
import Quickshell.Widgets
import qs.Common
import qs.DankCommon.Widgets as DankCommon
Item {
id: root
required property string source
property int size: 24
property string cornerIcon: ""
property int cornerIconSize: Math.max(10, size * 0.4)
property color cornerIconColor: Theme.surfaceText
property color cornerIconBackground: Theme.surface
property color colorOverride: "transparent"
property real brightnessOverride: 0.0
property real contrastOverride: 0.0
property real saturationOverride: 0.0
readonly property bool hasCornerIcon: cornerIcon !== ""
readonly property bool hasColorOverride: colorOverride.a > 0
readonly property bool hasColorEffect: hasColorOverride || brightnessOverride !== 0.0 || contrastOverride !== 0.0 || saturationOverride !== 0.0
readonly property string resolvedSource: {
if (!source)
return "";
if (source.startsWith("file://"))
return source;
if (source.startsWith("/"))
return "file://" + source;
if (source.startsWith("qrc:"))
return source;
return source;
}
implicitWidth: size
implicitHeight: size
IconImage {
id: iconImage
anchors.fill: parent
source: root.resolvedSource
smooth: true
mipmap: true
asynchronous: true
implicitSize: root.size * 2
backer.sourceSize.width: root.size * 2
backer.sourceSize.height: root.size * 2
backer.cache: true
layer.enabled: root.hasColorEffect
layer.smooth: true
layer.mipmap: true
layer.effect: MultiEffect {
saturation: root.saturationOverride
colorization: root.hasColorOverride ? 1 : 0
colorizationColor: root.colorOverride
brightness: root.brightnessOverride
contrast: root.contrastOverride
}
}
Rectangle {
visible: root.hasCornerIcon
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.rightMargin: -2
anchors.bottomMargin: -2
width: root.cornerIconSize + 4
height: root.cornerIconSize + 4
radius: width / 2
color: root.cornerIconBackground
border.width: 1
border.color: Theme.surfaceLight
DankIcon {
anchors.centerIn: parent
name: root.cornerIcon
size: root.cornerIconSize
color: root.cornerIconColor
}
}
}
DankCommon.DankSVGIcon {}