mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-04 04:42:05 -04:00
blur: add blur support with ext-bg-effect
This commit is contained in:
@@ -14,6 +14,7 @@ Item {
|
||||
property real barThickness: 48
|
||||
property real barSpacing: 4
|
||||
property var barConfig: null
|
||||
property var blurBarWindow: null
|
||||
property bool overrideAxisLayout: false
|
||||
property bool forceVerticalLayout: false
|
||||
|
||||
@@ -357,6 +358,7 @@ Item {
|
||||
barThickness: root.barThickness
|
||||
barSpacing: root.barSpacing
|
||||
barConfig: root.barConfig
|
||||
blurBarWindow: root.blurBarWindow
|
||||
isFirst: index === 0
|
||||
isLast: index === centerRepeater.count - 1
|
||||
sectionSpacing: parent.itemSpacing
|
||||
|
||||
@@ -14,6 +14,8 @@ Item {
|
||||
required property var rootWindow
|
||||
required property var barConfig
|
||||
|
||||
readonly property var blurBarWindow: barWindow
|
||||
|
||||
property var leftWidgetsModel
|
||||
property var centerWidgetsModel
|
||||
property var rightWidgetsModel
|
||||
@@ -408,6 +410,12 @@ Item {
|
||||
value: topBarContent.barConfig
|
||||
restoreMode: Binding.RestoreNone
|
||||
}
|
||||
Binding {
|
||||
target: hLeftSection
|
||||
property: "blurBarWindow"
|
||||
value: topBarContent.blurBarWindow
|
||||
restoreMode: Binding.RestoreNone
|
||||
}
|
||||
|
||||
RightSection {
|
||||
id: hRightSection
|
||||
@@ -434,6 +442,12 @@ Item {
|
||||
value: topBarContent.barConfig
|
||||
restoreMode: Binding.RestoreNone
|
||||
}
|
||||
Binding {
|
||||
target: hRightSection
|
||||
property: "blurBarWindow"
|
||||
value: topBarContent.blurBarWindow
|
||||
restoreMode: Binding.RestoreNone
|
||||
}
|
||||
|
||||
CenterSection {
|
||||
id: hCenterSection
|
||||
@@ -460,6 +474,12 @@ Item {
|
||||
value: topBarContent.barConfig
|
||||
restoreMode: Binding.RestoreNone
|
||||
}
|
||||
Binding {
|
||||
target: hCenterSection
|
||||
property: "blurBarWindow"
|
||||
value: topBarContent.blurBarWindow
|
||||
restoreMode: Binding.RestoreNone
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
@@ -493,6 +513,12 @@ Item {
|
||||
value: topBarContent.barConfig
|
||||
restoreMode: Binding.RestoreNone
|
||||
}
|
||||
Binding {
|
||||
target: vLeftSection
|
||||
property: "blurBarWindow"
|
||||
value: topBarContent.blurBarWindow
|
||||
restoreMode: Binding.RestoreNone
|
||||
}
|
||||
|
||||
CenterSection {
|
||||
id: vCenterSection
|
||||
@@ -520,6 +546,12 @@ Item {
|
||||
value: topBarContent.barConfig
|
||||
restoreMode: Binding.RestoreNone
|
||||
}
|
||||
Binding {
|
||||
target: vCenterSection
|
||||
property: "blurBarWindow"
|
||||
value: topBarContent.blurBarWindow
|
||||
restoreMode: Binding.RestoreNone
|
||||
}
|
||||
|
||||
RightSection {
|
||||
id: vRightSection
|
||||
@@ -548,6 +580,12 @@ Item {
|
||||
value: topBarContent.barConfig
|
||||
restoreMode: Binding.RestoreNone
|
||||
}
|
||||
Binding {
|
||||
target: vRightSection
|
||||
property: "blurBarWindow"
|
||||
value: topBarContent.blurBarWindow
|
||||
restoreMode: Binding.RestoreNone
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -97,6 +97,97 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
|
||||
property var blurRegion: null
|
||||
property var _blurWidgetItems: []
|
||||
|
||||
function registerBlurWidget(item) {
|
||||
if (_blurWidgetItems.indexOf(item) >= 0)
|
||||
return;
|
||||
_blurWidgetItems = _blurWidgetItems.concat([item]);
|
||||
_blurRebuildTimer.restart();
|
||||
}
|
||||
|
||||
function unregisterBlurWidget(item) {
|
||||
const idx = _blurWidgetItems.indexOf(item);
|
||||
if (idx < 0)
|
||||
return;
|
||||
const arr = _blurWidgetItems.slice();
|
||||
arr.splice(idx, 1);
|
||||
_blurWidgetItems = arr;
|
||||
_blurRebuildTimer.restart();
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: _blurRebuildTimer
|
||||
interval: 1
|
||||
onTriggered: barBlur.rebuild()
|
||||
}
|
||||
|
||||
Item {
|
||||
id: barBlur
|
||||
visible: false
|
||||
|
||||
readonly property bool barHasTransparency: barWindow._backgroundAlpha > 0 && barWindow._backgroundAlpha < 1
|
||||
|
||||
function rebuild() {
|
||||
teardown();
|
||||
if (!BlurService.enabled || !BlurService.available)
|
||||
return;
|
||||
|
||||
const widgets = barWindow._blurWidgetItems.filter(w => w && w.visible && w.width > 0 && w.height > 0);
|
||||
const hasBar = barHasTransparency;
|
||||
if (!hasBar && widgets.length === 0)
|
||||
return;
|
||||
|
||||
const cr = Theme.cornerRadius;
|
||||
let qml = 'import QtQuick; import Quickshell; Region {';
|
||||
for (let i = 0; i < widgets.length; i++) {
|
||||
qml += ` property Item w${i}; Region { item: w${i}; radius: ${cr} }`;
|
||||
}
|
||||
qml += '}';
|
||||
|
||||
try {
|
||||
const region = Qt.createQmlObject(qml, barWindow, "BarBlurRegion");
|
||||
|
||||
if (hasBar) {
|
||||
region.item = Qt.binding(() => barUnitInset);
|
||||
region.radius = Qt.binding(() => barBackground.rt);
|
||||
}
|
||||
|
||||
for (let i = 0; i < widgets.length; i++) {
|
||||
region[`w${i}`] = widgets[i];
|
||||
}
|
||||
|
||||
barWindow.BackgroundEffect.blurRegion = region;
|
||||
barWindow.blurRegion = region;
|
||||
} catch (e) {
|
||||
console.warn("BarBlur: Failed to create blur region:", e);
|
||||
}
|
||||
}
|
||||
|
||||
function teardown() {
|
||||
if (!barWindow.blurRegion)
|
||||
return;
|
||||
try {
|
||||
barWindow.BackgroundEffect.blurRegion = null;
|
||||
} catch (e) {}
|
||||
barWindow.blurRegion.destroy();
|
||||
barWindow.blurRegion = null;
|
||||
}
|
||||
|
||||
onBarHasTransparencyChanged: _blurRebuildTimer.restart()
|
||||
|
||||
Connections {
|
||||
target: BlurService
|
||||
function onEnabledChanged() {
|
||||
barBlur.rebuild();
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: rebuild()
|
||||
Component.onDestruction: teardown()
|
||||
}
|
||||
|
||||
WlrLayershell.layer: dBarLayer
|
||||
WlrLayershell.namespace: "dms:bar"
|
||||
|
||||
@@ -711,7 +802,8 @@ PanelWindow {
|
||||
onHasActivePopoutChanged: evaluateReveal()
|
||||
|
||||
function updateActivePopoutState() {
|
||||
if (!barWindow.screen) return;
|
||||
if (!barWindow.screen)
|
||||
return;
|
||||
const screenName = barWindow.screen.name;
|
||||
const activePopout = PopoutManager.currentPopoutsByScreen[screenName];
|
||||
const activeTrayMenu = TrayMenuManager.activeTrayMenus[screenName];
|
||||
|
||||
@@ -13,6 +13,7 @@ Item {
|
||||
property real barThickness: 48
|
||||
property real barSpacing: 4
|
||||
property var barConfig: null
|
||||
property var blurBarWindow: null
|
||||
property bool overrideAxisLayout: false
|
||||
property bool forceVerticalLayout: false
|
||||
|
||||
@@ -59,6 +60,7 @@ Item {
|
||||
barThickness: root.barThickness
|
||||
barSpacing: root.barSpacing
|
||||
barConfig: root.barConfig
|
||||
blurBarWindow: root.blurBarWindow
|
||||
isFirst: index === 0
|
||||
isLast: index === rowRepeater.count - 1
|
||||
sectionSpacing: parent.rowSpacing
|
||||
@@ -103,6 +105,7 @@ Item {
|
||||
barThickness: root.barThickness
|
||||
barSpacing: root.barSpacing
|
||||
barConfig: root.barConfig
|
||||
blurBarWindow: root.blurBarWindow
|
||||
isFirst: index === 0
|
||||
isLast: index === columnRepeater.count - 1
|
||||
sectionSpacing: parent.columnSpacing
|
||||
|
||||
@@ -13,6 +13,7 @@ Item {
|
||||
property real barThickness: 48
|
||||
property real barSpacing: 4
|
||||
property var barConfig: null
|
||||
property var blurBarWindow: null
|
||||
property bool overrideAxisLayout: false
|
||||
property bool forceVerticalLayout: false
|
||||
|
||||
@@ -61,6 +62,7 @@ Item {
|
||||
barThickness: root.barThickness
|
||||
barSpacing: root.barSpacing
|
||||
barConfig: root.barConfig
|
||||
blurBarWindow: root.blurBarWindow
|
||||
isFirst: index === 0
|
||||
isLast: index === rowRepeater.count - 1
|
||||
sectionSpacing: parent.rowSpacing
|
||||
@@ -105,6 +107,7 @@ Item {
|
||||
barThickness: root.barThickness
|
||||
barSpacing: root.barSpacing
|
||||
barConfig: root.barConfig
|
||||
blurBarWindow: root.blurBarWindow
|
||||
isFirst: index === 0
|
||||
isLast: index === columnRepeater.count - 1
|
||||
sectionSpacing: parent.columnSpacing
|
||||
|
||||
@@ -16,6 +16,7 @@ Loader {
|
||||
property real barThickness: 48
|
||||
property real barSpacing: 4
|
||||
property var barConfig: null
|
||||
property var blurBarWindow: null
|
||||
property bool isFirst: false
|
||||
property bool isLast: false
|
||||
property real sectionSpacing: 0
|
||||
@@ -92,6 +93,14 @@ Loader {
|
||||
restoreMode: Binding.RestoreNone
|
||||
}
|
||||
|
||||
Binding {
|
||||
target: root.item
|
||||
when: root.item && "blurBarWindow" in root.item
|
||||
property: "blurBarWindow"
|
||||
value: root.blurBarWindow
|
||||
restoreMode: Binding.RestoreNone
|
||||
}
|
||||
|
||||
Binding {
|
||||
target: root.item
|
||||
when: root.item && "axis" in root.item
|
||||
|
||||
@@ -630,7 +630,7 @@ BasePill {
|
||||
if (appItem.isFocused && colorizeEnabled) {
|
||||
return mouseArea.containsMouse ? Theme.withAlpha(Qt.lighter(appItem.activeOverlayColor, 1.3), 0.4) : Theme.withAlpha(appItem.activeOverlayColor, 0.3);
|
||||
}
|
||||
return mouseArea.containsMouse ? Theme.widgetBaseHoverColor : "transparent";
|
||||
return mouseArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : "transparent";
|
||||
}
|
||||
|
||||
border.width: dragHandler.dragging ? 2 : 0
|
||||
|
||||
@@ -3,6 +3,7 @@ import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import qs.Common
|
||||
import qs.Modules.Plugins
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
BasePill {
|
||||
@@ -93,6 +94,15 @@ BasePill {
|
||||
PanelWindow {
|
||||
id: contextMenuWindow
|
||||
|
||||
WindowBlur {
|
||||
targetWindow: contextMenuWindow
|
||||
blurX: menuContainer.x
|
||||
blurY: menuContainer.y
|
||||
blurWidth: contextMenuWindow.visible ? menuContainer.width : 0
|
||||
blurHeight: contextMenuWindow.visible ? menuContainer.height : 0
|
||||
blurRadius: Theme.cornerRadius
|
||||
}
|
||||
|
||||
WlrLayershell.namespace: "dms:clipboard-context-menu"
|
||||
|
||||
property bool isVertical: false
|
||||
@@ -187,8 +197,8 @@ BasePill {
|
||||
height: Math.max(64, menuColumn.implicitHeight + Theme.spacingS * 2)
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.width: 1
|
||||
border.color: BlurService.enabled ? BlurService.borderColor : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.width: BlurService.enabled ? BlurService.borderWidth : 1
|
||||
|
||||
opacity: contextMenuWindow.visible ? 1 : 0
|
||||
visible: opacity > 0
|
||||
@@ -224,7 +234,7 @@ BasePill {
|
||||
width: parent.width
|
||||
height: 30
|
||||
radius: Theme.cornerRadius
|
||||
color: clearAllArea.containsMouse ? Theme.widgetBaseHoverColor : "transparent"
|
||||
color: clearAllArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : "transparent"
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
@@ -264,7 +274,7 @@ BasePill {
|
||||
width: parent.width
|
||||
height: 30
|
||||
radius: Theme.cornerRadius
|
||||
color: savedItemsArea.containsMouse ? Theme.widgetBaseHoverColor : "transparent"
|
||||
color: savedItemsArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : "transparent"
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -354,7 +354,7 @@ BasePill {
|
||||
height: 20
|
||||
radius: 10
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: prevArea.containsMouse ? Theme.widgetBaseHoverColor : "transparent"
|
||||
color: prevArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : "transparent"
|
||||
visible: root.playerAvailable
|
||||
opacity: (activePlayer && activePlayer.canGoPrevious) ? 1 : 0.3
|
||||
|
||||
@@ -411,7 +411,7 @@ BasePill {
|
||||
height: 20
|
||||
radius: 10
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: nextArea.containsMouse ? Theme.widgetBaseHoverColor : "transparent"
|
||||
color: nextArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : "transparent"
|
||||
visible: playerAvailable
|
||||
opacity: (activePlayer && activePlayer.canGoNext) ? 1 : 0.3
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ BasePill {
|
||||
width: parent.width
|
||||
height: 30
|
||||
radius: Theme.cornerRadius
|
||||
color: tabArea.containsMouse ? Theme.widgetBaseHoverColor : "transparent"
|
||||
color: tabArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : "transparent"
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
@@ -327,7 +327,7 @@ BasePill {
|
||||
width: parent.width
|
||||
height: 30
|
||||
radius: Theme.cornerRadius
|
||||
color: newNoteArea.containsMouse ? Theme.widgetBaseHoverColor : "transparent"
|
||||
color: newNoteArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : "transparent"
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -273,7 +273,7 @@ BasePill {
|
||||
if (isFocused) {
|
||||
return mouseArea.containsMouse ? Theme.primarySelected : Theme.withAlpha(Theme.primary, 0.2);
|
||||
}
|
||||
return mouseArea.containsMouse ? Theme.widgetBaseHoverColor : "transparent";
|
||||
return mouseArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : "transparent";
|
||||
}
|
||||
|
||||
// App icon
|
||||
@@ -528,7 +528,7 @@ BasePill {
|
||||
if (isFocused) {
|
||||
return mouseArea.containsMouse ? Theme.primarySelected : Theme.withAlpha(Theme.primary, 0.2);
|
||||
}
|
||||
return mouseArea.containsMouse ? Theme.widgetBaseHoverColor : "transparent";
|
||||
return mouseArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : "transparent";
|
||||
}
|
||||
|
||||
IconImage {
|
||||
@@ -738,6 +738,15 @@ BasePill {
|
||||
sourceComponent: PanelWindow {
|
||||
id: contextMenuWindow
|
||||
|
||||
WindowBlur {
|
||||
targetWindow: contextMenuWindow
|
||||
blurX: contextMenuRect.x
|
||||
blurY: contextMenuRect.y
|
||||
blurWidth: contextMenuWindow.isVisible ? contextMenuRect.width : 0
|
||||
blurHeight: contextMenuWindow.isVisible ? contextMenuRect.height : 0
|
||||
blurRadius: Theme.cornerRadius
|
||||
}
|
||||
|
||||
property var currentWindow: null
|
||||
property bool isVisible: false
|
||||
property point anchorPos: Qt.point(0, 0)
|
||||
@@ -830,6 +839,7 @@ BasePill {
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: contextMenuRect
|
||||
x: {
|
||||
if (contextMenuWindow.isVertical) {
|
||||
if (contextMenuWindow.edge === "left") {
|
||||
@@ -858,13 +868,13 @@ BasePill {
|
||||
height: 32
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
border.width: 1
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
||||
border.width: BlurService.enabled ? BlurService.borderWidth : 1
|
||||
border.color: BlurService.enabled ? BlurService.borderColor : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: parent.radius
|
||||
color: closeMouseArea.containsMouse ? Theme.widgetBaseHoverColor : "transparent"
|
||||
color: closeMouseArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : "transparent"
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
||||
@@ -287,7 +287,7 @@ BasePill {
|
||||
height: root.trayItemSize
|
||||
anchors.centerIn: parent
|
||||
radius: Theme.cornerRadius
|
||||
color: trayItemArea.containsMouse ? Theme.widgetBaseHoverColor : "transparent"
|
||||
color: trayItemArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : "transparent"
|
||||
border.width: dragHandler.dragging ? 2 : 0
|
||||
border.color: Theme.primary
|
||||
opacity: dragHandler.dragging ? 0.8 : 1.0
|
||||
@@ -425,7 +425,7 @@ BasePill {
|
||||
height: root.trayItemSize
|
||||
anchors.centerIn: parent
|
||||
radius: Theme.cornerRadius
|
||||
color: caretArea.containsMouse ? Theme.widgetBaseHoverColor : "transparent"
|
||||
color: caretArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : "transparent"
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
@@ -547,7 +547,7 @@ BasePill {
|
||||
height: root.trayItemSize
|
||||
anchors.centerIn: parent
|
||||
radius: Theme.cornerRadius
|
||||
color: trayItemArea.containsMouse ? Theme.widgetBaseHoverColor : "transparent"
|
||||
color: trayItemArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : "transparent"
|
||||
border.width: dragHandler.dragging ? 2 : 0
|
||||
border.color: Theme.primary
|
||||
opacity: dragHandler.dragging ? 0.8 : 1.0
|
||||
@@ -685,7 +685,7 @@ BasePill {
|
||||
height: root.trayItemSize
|
||||
anchors.centerIn: parent
|
||||
radius: Theme.cornerRadius
|
||||
color: caretAreaVert.containsMouse ? Theme.widgetBaseHoverColor : "transparent"
|
||||
color: caretAreaVert.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : "transparent"
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
@@ -723,6 +723,16 @@ BasePill {
|
||||
|
||||
PanelWindow {
|
||||
id: overflowMenu
|
||||
|
||||
WindowBlur {
|
||||
targetWindow: overflowMenu
|
||||
blurX: menuContainer.x
|
||||
blurY: menuContainer.y
|
||||
blurWidth: root.menuOpen ? menuContainer.width : 0
|
||||
blurHeight: root.menuOpen ? menuContainer.height : 0
|
||||
blurRadius: Theme.cornerRadius
|
||||
}
|
||||
|
||||
visible: root.menuOpen
|
||||
screen: root.parentScreen
|
||||
WlrLayershell.layer: WlrLayershell.Top
|
||||
@@ -990,6 +1000,15 @@ BasePill {
|
||||
layer.samples: 4
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "transparent"
|
||||
radius: Theme.cornerRadius
|
||||
border.color: BlurService.borderColor
|
||||
border.width: BlurService.borderWidth
|
||||
z: 100
|
||||
}
|
||||
|
||||
Grid {
|
||||
id: menuGrid
|
||||
anchors.centerIn: parent
|
||||
@@ -1030,7 +1049,7 @@ BasePill {
|
||||
width: root.trayItemSize + 4
|
||||
height: root.trayItemSize + 4
|
||||
radius: Theme.cornerRadius
|
||||
color: itemArea.containsMouse ? Theme.widgetBaseHoverColor : Theme.withAlpha(Theme.surfaceContainer, 0)
|
||||
color: itemArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : Theme.withAlpha(Theme.surfaceContainer, 0)
|
||||
|
||||
IconImage {
|
||||
id: menuIconImg
|
||||
@@ -1191,6 +1210,15 @@ BasePill {
|
||||
PanelWindow {
|
||||
id: menuWindow
|
||||
|
||||
WindowBlur {
|
||||
targetWindow: menuWindow
|
||||
blurX: trayMenuContainer.x
|
||||
blurY: trayMenuContainer.y
|
||||
blurWidth: menuRoot.showMenu ? trayMenuContainer.width : 0
|
||||
blurHeight: menuRoot.showMenu ? trayMenuContainer.height : 0
|
||||
blurRadius: Theme.cornerRadius
|
||||
}
|
||||
|
||||
WlrLayershell.namespace: "dms:tray-menu-window"
|
||||
visible: menuRoot.showMenu && (menuRoot.trayItem?.hasMenu ?? false)
|
||||
WlrLayershell.layer: WlrLayershell.Top
|
||||
@@ -1302,7 +1330,7 @@ BasePill {
|
||||
onClicked: mouse => {
|
||||
const clickX = mouse.x + menuWindow.maskX;
|
||||
const clickY = mouse.y + menuWindow.maskY;
|
||||
const outsideContent = clickX < menuContainer.x || clickX > menuContainer.x + menuContainer.width || clickY < menuContainer.y || clickY > menuContainer.y + menuContainer.height;
|
||||
const outsideContent = clickX < trayMenuContainer.x || clickX > trayMenuContainer.x + trayMenuContainer.width || clickY < trayMenuContainer.y || clickY > trayMenuContainer.y + trayMenuContainer.height;
|
||||
|
||||
if (!outsideContent)
|
||||
return;
|
||||
@@ -1360,7 +1388,7 @@ BasePill {
|
||||
}
|
||||
|
||||
Item {
|
||||
id: menuContainer
|
||||
id: trayMenuContainer
|
||||
|
||||
readonly property real rawWidth: Math.min(500, Math.max(250, menuColumn.implicitWidth + Theme.spacingS * 2))
|
||||
readonly property real rawHeight: Math.max(40, menuColumn.implicitHeight + Theme.spacingS * 2)
|
||||
@@ -1438,6 +1466,15 @@ BasePill {
|
||||
layer.textureMirroring: ShaderEffectSource.MirrorVertically
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "transparent"
|
||||
radius: Theme.cornerRadius
|
||||
border.color: BlurService.borderColor
|
||||
border.width: BlurService.borderWidth
|
||||
z: 100
|
||||
}
|
||||
|
||||
QsMenuAnchor {
|
||||
id: submenuHydrator
|
||||
anchor.window: menuWindow
|
||||
@@ -1470,7 +1507,7 @@ BasePill {
|
||||
width: parent.width
|
||||
height: 28
|
||||
radius: Theme.cornerRadius
|
||||
color: visibilityToggleArea.containsMouse ? Theme.widgetBaseHoverColor : Theme.withAlpha(Theme.surfaceContainer, 0)
|
||||
color: visibilityToggleArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : Theme.withAlpha(Theme.surfaceContainer, 0)
|
||||
|
||||
StyledText {
|
||||
anchors.left: parent.left
|
||||
@@ -1523,7 +1560,7 @@ BasePill {
|
||||
width: parent.width
|
||||
height: 28
|
||||
radius: Theme.cornerRadius
|
||||
color: backArea.containsMouse ? Theme.widgetBaseHoverColor : Theme.withAlpha(Theme.surfaceContainer, 0)
|
||||
color: backArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : Theme.withAlpha(Theme.surfaceContainer, 0)
|
||||
|
||||
Row {
|
||||
anchors.left: parent.left
|
||||
@@ -1574,7 +1611,7 @@ BasePill {
|
||||
color: {
|
||||
if (menuEntry?.isSeparator)
|
||||
return Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2);
|
||||
return itemArea.containsMouse ? Theme.widgetBaseHoverColor : Theme.withAlpha(Theme.surfaceContainer, 0);
|
||||
return itemArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : Theme.withAlpha(Theme.surfaceContainer, 0);
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
|
||||
@@ -17,6 +17,7 @@ Item {
|
||||
property real widgetHeight: 30
|
||||
property real barThickness: 48
|
||||
property var barConfig: null
|
||||
property var blurBarWindow: null
|
||||
property var hyprlandOverviewLoader: null
|
||||
property var parentScreen: null
|
||||
property int _desktopEntriesUpdateTrigger: 0
|
||||
@@ -1845,5 +1846,27 @@ Item {
|
||||
if (useExtWorkspace && !DMSService.activeSubscriptions.includes("extworkspace")) {
|
||||
DMSService.addSubscription("extworkspace");
|
||||
}
|
||||
_updateBlurRegistration();
|
||||
}
|
||||
|
||||
property bool _blurRegistered: false
|
||||
readonly property bool _shouldBlur: BlurService.enabled && blurBarWindow && blurBarWindow.registerBlurWidget && !(barConfig?.noBackground ?? false) && root.visible && root.width > 0
|
||||
|
||||
on_ShouldBlurChanged: _updateBlurRegistration()
|
||||
|
||||
function _updateBlurRegistration() {
|
||||
if (_shouldBlur && !_blurRegistered) {
|
||||
blurBarWindow.registerBlurWidget(visualBackground);
|
||||
_blurRegistered = true;
|
||||
} else if (!_shouldBlur && _blurRegistered) {
|
||||
if (blurBarWindow && blurBarWindow.unregisterBlurWidget)
|
||||
blurBarWindow.unregisterBlurWidget(visualBackground);
|
||||
_blurRegistered = false;
|
||||
}
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
if (_blurRegistered && blurBarWindow && blurBarWindow.unregisterBlurWidget)
|
||||
blurBarWindow.unregisterBlurWidget(visualBackground);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user