1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-29 07:52:50 -05:00

namespace tweaks for blur and layer targets

This commit is contained in:
bbedward
2025-11-03 21:28:40 -05:00
parent fc0082a470
commit 4f59dfc49c
10 changed files with 103 additions and 43 deletions

View File

@@ -36,7 +36,7 @@ Rectangle {
width: cellWidth - cellPadding
height: cellHeight - cellPadding
radius: Theme.cornerRadius
color: currentIndex === index ? Theme.primaryPressed : mouseArea.containsMouse ? Theme.primaryHoverLight : Theme.surfaceContainerHigh
color: currentIndex === index ? Theme.surfaceContainerHighest : mouseArea.containsMouse ? Theme.surfaceContainerHighest : Theme.surfaceContainerHigh
Column {
anchors.centerIn: parent

View File

@@ -34,7 +34,7 @@ Rectangle {
width: listView.width
height: itemHeight
radius: Theme.cornerRadius
color: isCurrentItem ? Theme.primaryPressed : mouseArea.containsMouse ? Theme.primaryHoverLight : Theme.surfaceContainerHigh
color: isCurrentItem ? Theme.surfaceContainerHighest : mouseArea.containsMouse ? Theme.surfaceContainerHighest : Theme.surfaceContainerHigh
Row {
anchors.fill: parent

View File

@@ -3,10 +3,14 @@ import QtQuick.Effects
import Quickshell
import Quickshell.Wayland
import qs.Common
import qs.Services
PanelWindow {
id: root
property string blurNamespace: "dms:osd"
WlrLayershell.namespace: blurNamespace
property alias content: contentLoader.sourceComponent
property alias contentLoader: contentLoader
property var modelData
@@ -63,6 +67,14 @@ PanelWindow {
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
color: "transparent"
readonly property real dpr: CompositorService.getScreenScale(screen)
readonly property real screenWidth: screen.width
readonly property real screenHeight: screen.height
readonly property real alignedWidth: Theme.px(osdWidth, dpr)
readonly property real alignedHeight: Theme.px(osdHeight, dpr)
readonly property real alignedX: Theme.snap((screenWidth - alignedWidth) / 2, dpr)
readonly property real alignedY: Theme.snap(screenHeight - alignedHeight - Theme.spacingM, dpr)
anchors {
top: true
left: true
@@ -95,23 +107,25 @@ PanelWindow {
}
}
Rectangle {
Item {
id: osdContainer
x: alignedX
y: alignedY
width: alignedWidth
height: alignedHeight
opacity: shouldBeVisible ? 1 : 0
scale: shouldBeVisible ? 1 : 0.9
property bool childHovered: false
width: osdWidth
height: osdHeight
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: Theme.spacingM
color: Theme.popupBackground()
radius: Theme.cornerRadius
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
border.width: 1
opacity: shouldBeVisible ? 1 : 0
scale: shouldBeVisible ? 1 : 0.9
layer.enabled: true
Rectangle {
id: osdBackground
anchors.fill: parent
color: Theme.popupBackground()
radius: Theme.cornerRadius
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
border.width: 1
}
MouseArea {
id: mouseArea
@@ -132,14 +146,6 @@ PanelWindow {
asynchronous: false
}
layer.effect: MultiEffect {
shadowEnabled: true
shadowHorizontalOffset: 0
shadowVerticalOffset: 4
shadowBlur: 0.8
shadowColor: Qt.rgba(0, 0, 0, 0.3)
}
Behavior on opacity {
NumberAnimation {
duration: animationDuration
@@ -156,6 +162,6 @@ PanelWindow {
}
mask: Region {
item: osdContainer
item: osdBackground
}
}

View File

@@ -8,7 +8,8 @@ import qs.Services
PanelWindow {
id: root
WlrLayershell.namespace: "quickshell:popout"
property string blurNamespace: "dms:popout"
WlrLayershell.namespace: blurNamespace
property alias content: contentLoader.sourceComponent
property alias contentLoader: contentLoader