mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-03 11:02:08 -04:00
Sync up Frame w/Master branch updates
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,7 +272,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
|
||||
@@ -286,7 +286,7 @@ PanelWindow {
|
||||
level: Theme.elevationLevel3
|
||||
fallbackOffset: 6
|
||||
targetRadius: Theme.cornerRadius
|
||||
targetColor: Theme.withAlpha(Theme.surfaceContainer, osdContainer.popupSurfaceAlpha)
|
||||
targetColor: Theme.transparentBlurLayers ? "transparent" : Theme.withAlpha(Theme.surfaceContainer, osdContainer.popupSurfaceAlpha)
|
||||
borderColor: Theme.outlineMedium
|
||||
borderWidth: 1
|
||||
shadowEnabled: Theme.elevationEnabled && SettingsData.popoutElevationEnabled && Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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: slider.trackColor
|
||||
color: Theme.withAlpha(slider.trackColor, slider.trackOpacity)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
clip: false
|
||||
|
||||
@@ -71,13 +72,16 @@ Item {
|
||||
id: sliderFill
|
||||
height: parent.height
|
||||
radius: Theme.cornerRadius
|
||||
topRightRadius: 0
|
||||
bottomRightRadius: 0
|
||||
width: {
|
||||
const range = slider.maximum - slider.minimum;
|
||||
const rawRatio = range === 0 ? 0 : (slider.value - slider.minimum) / range;
|
||||
const ratio = slider.centerMinimum ? (0.5 + rawRatio * 0.5) : rawRatio;
|
||||
const travel = sliderTrack.width - sliderHandle.width;
|
||||
const center = (travel * ratio) + sliderHandle.width / 2;
|
||||
return Math.max(0, Math.min(sliderTrack.width, center));
|
||||
const handleLeft = travel * ratio;
|
||||
const endPoint = handleLeft - 3;
|
||||
return Math.max(0, Math.min(sliderTrack.width, endPoint));
|
||||
}
|
||||
color: slider.enabled ? Theme.primary : Theme.withAlpha(Theme.onSurface, 0.12)
|
||||
}
|
||||
@@ -87,8 +91,8 @@ Item {
|
||||
|
||||
property bool active: sliderMouseArea.containsMouse || sliderMouseArea.pressed || slider.isDragging
|
||||
|
||||
width: 8
|
||||
height: 24
|
||||
width: 4
|
||||
height: 20
|
||||
radius: Theme.cornerRadius
|
||||
x: {
|
||||
const range = slider.maximum - slider.minimum;
|
||||
@@ -99,7 +103,7 @@ Item {
|
||||
}
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: slider.enabled ? Theme.primary : Theme.withAlpha(Theme.onSurface, 0.12)
|
||||
border.width: 3
|
||||
border.width: 0
|
||||
border.color: slider.thumbOutlineColor
|
||||
|
||||
StyledRect {
|
||||
|
||||
@@ -2,7 +2,6 @@ import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
|
||||
PanelWindow {
|
||||
id: root
|
||||
@@ -72,10 +71,10 @@ PanelWindow {
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: BlurService.enabled ? Theme.surfaceContainerHigh : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
border.width: BlurService.enabled ? BlurService.borderWidth : 1
|
||||
border.color: BlurService.enabled ? BlurService.borderColor : Theme.outlineMedium
|
||||
border.width: 1
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
|
||||
Text {
|
||||
id: textContent
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@@ -112,10 +111,10 @@ Item {
|
||||
dim: false
|
||||
|
||||
background: Rectangle {
|
||||
color: BlurService.enabled ? Theme.surfaceContainerHigh : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
border.width: BlurService.enabled ? BlurService.borderWidth : 1
|
||||
border.color: BlurService.enabled ? BlurService.borderColor : Theme.outlineMedium
|
||||
border.width: 1
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
}
|
||||
|
||||
contentItem: Text {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user