1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-05-02 10:32:07 -04:00

dms(blur): Dank all the things

This commit is contained in:
purian23
2026-04-24 22:52:14 -04:00
committed by bbedward
parent 4c617cf022
commit c10b42f599
56 changed files with 538 additions and 265 deletions

View File

@@ -1,4 +1,5 @@
import QtQuick
import Quickshell.Io
import qs.Common
Item {
@@ -68,11 +69,11 @@ Item {
smooth: true
onStatusChanged: {
if (source == root.cachePath && status === Image.Error) {
if (source === root.cachePath && status === Image.Error) {
source = root.encodedImagePath;
return;
}
if (root.isRemoteUrl || source != root.encodedImagePath || status !== Image.Ready || !root.cachePath)
if (root.isRemoteUrl || source !== root.encodedImagePath || status !== Image.Ready || !root.cachePath)
return;
Paths.mkdir(Paths.imagecache);
const grabPath = root.cachePath;
@@ -82,6 +83,22 @@ Item {
}
}
Process {
id: cacheProbe
property string cachePath: ""
property string fallbackSource: ""
running: false
command: ["test", "-f", cachePath]
onExited: exitCode => {
if (cacheProbe.cachePath !== root.cachePath)
return;
staticImg.source = exitCode === 0 ? cacheProbe.cachePath : cacheProbe.fallbackSource;
}
}
onImagePathChanged: {
if (!imagePath) {
staticImg.source = "";
@@ -97,6 +114,13 @@ Item {
const hash = djb2Hash(normalizedPath);
const cPath = hash ? `${Paths.stringify(Paths.imagecache)}/${hash}@${maxCacheSize}x${maxCacheSize}.png` : "";
const encoded = "file://" + normalizedPath.split('/').map(s => encodeURIComponent(s)).join('/');
staticImg.source = cPath || encoded;
if (!cPath) {
staticImg.source = encoded;
return;
}
cacheProbe.running = false;
cacheProbe.cachePath = cPath;
cacheProbe.fallbackSource = encoded;
cacheProbe.running = true;
}
}

View File

@@ -277,7 +277,7 @@ PanelWindow {
id: background
anchors.fill: parent
radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainer, osdContainer.popupSurfaceAlpha)
color: Theme.transparentBlurLayers ? "transparent" : Theme.withAlpha(Theme.surfaceContainer, osdContainer.popupSurfaceAlpha)
border.color: BlurService.enabled ? BlurService.borderColor : Theme.outlineMedium
border.width: BlurService.enabled ? BlurService.borderWidth : 1
z: -1

View File

@@ -577,9 +577,10 @@ Item {
scale: contentWrapper.scale
visible: contentWrapper.visible
radius: Theme.cornerRadius
antialiasing: true
color: "transparent"
border.color: BlurService.enabled ? BlurService.borderColor : Theme.outlineMedium
border.width: BlurService.borderWidth
border.width: BlurService.enabled ? BlurService.borderWidth : 1
z: 100
}
}

View File

@@ -134,7 +134,7 @@ PanelWindow {
Rectangle {
anchors.fill: parent
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, contentRect.effectiveTransparency)
color: Theme.transparentBlurLayers ? "transparent" : Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, contentRect.effectiveTransparency)
radius: Theme.cornerRadius
border.color: BlurService.enabled ? BlurService.borderColor : Theme.outlineMedium
border.width: BlurService.borderWidth

View File

@@ -22,6 +22,7 @@ Item {
property color thumbOutlineColor: Theme.surfaceContainer
property color trackColor: enabled ? Theme.outline : Theme.outline
property real trackOpacity: Theme.popupTransparency
signal sliderValueChanged(int newValue)
signal sliderDragFinished(int finalValue)
@@ -63,7 +64,7 @@ Item {
width: parent.width - (leftIconWidth + rightIconWidth + (slider.leftIcon.length > 0 ? Theme.spacingM : 0) + (slider.rightIcon.length > 0 ? Theme.spacingM : 0))
height: 12
radius: Theme.cornerRadius
color: Theme.withAlpha(slider.trackColor, Theme.popupTransparency)
color: Theme.withAlpha(slider.trackColor, slider.trackOpacity)
anchors.verticalCenter: parent.verticalCenter
clip: false

View File

@@ -74,7 +74,7 @@ PanelWindow {
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
radius: Theme.cornerRadius
border.width: 1
border.color: Theme.outlineMedium
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
Text {
id: textContent

View File

@@ -114,7 +114,7 @@ Item {
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
radius: Theme.cornerRadius
border.width: 1
border.color: Theme.outlineMedium
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
}
contentItem: Text {

View File

@@ -19,7 +19,9 @@ Rectangle {
implicitHeight: 32 + 1 + listHeight + Theme.spacingS * 4 + Theme.spacingM * 2
radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
color: Theme.nestedSurface
border.color: Theme.outlineMedium
border.width: Theme.layerOutlineWidth
FileBrowserSurfaceModal {
id: fileBrowser