mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-02 18:42:06 -04:00
Sync up Frame w/Master branch updates
This commit is contained in:
@@ -59,7 +59,7 @@ Item {
|
||||
// M3 elevation shadow — Level 2 baseline (navigation bar), with per-bar override support
|
||||
readonly property bool hasPerBarOverride: (barConfig?.shadowIntensity ?? 0) > 0
|
||||
readonly property var elevLevel: Theme.elevationLevel2
|
||||
readonly property bool shadowEnabled: (Theme.elevationEnabled && (typeof SettingsData !== "undefined" ? (SettingsData.barElevationEnabled ?? true) : false)) || hasPerBarOverride
|
||||
readonly property bool shadowEnabled: !BlurService.enabled && ((Theme.elevationEnabled && (typeof SettingsData !== "undefined" ? (SettingsData.barElevationEnabled ?? true) : false)) || hasPerBarOverride)
|
||||
readonly property string autoBarShadowDirection: isTop ? "top" : (isBottom ? "bottom" : (isLeft ? "left" : (isRight ? "right" : "top")))
|
||||
readonly property string globalShadowDirection: Theme.elevationLightDirection === "autoBar" ? autoBarShadowDirection : Theme.elevationLightDirection
|
||||
readonly property string perBarShadowDirectionMode: barConfig?.shadowDirectionMode ?? "inherit"
|
||||
|
||||
@@ -287,7 +287,7 @@ DankPopout {
|
||||
width: (parent.width - Theme.spacingM) / 2
|
||||
height: 64
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
color: Theme.nestedSurface
|
||||
border.width: 0
|
||||
|
||||
Column {
|
||||
@@ -322,7 +322,7 @@ DankPopout {
|
||||
width: (parent.width - Theme.spacingM) / 2
|
||||
height: 64
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
color: Theme.nestedSurface
|
||||
border.width: 0
|
||||
|
||||
Column {
|
||||
@@ -373,7 +373,7 @@ DankPopout {
|
||||
width: parent.width
|
||||
height: batteryColumn.implicitHeight + Theme.spacingM * 2
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
color: Theme.nestedSurface
|
||||
border.width: 0
|
||||
|
||||
Column {
|
||||
@@ -443,7 +443,7 @@ DankPopout {
|
||||
width: (parent.width - Theme.spacingS * 2) / 3
|
||||
height: 48
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
color: Theme.nestedSurface
|
||||
border.width: 0
|
||||
|
||||
Column {
|
||||
@@ -480,7 +480,7 @@ DankPopout {
|
||||
width: (parent.width - Theme.spacingS * 2) / 3
|
||||
height: 48
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
color: Theme.nestedSurface
|
||||
border.width: 0
|
||||
|
||||
Column {
|
||||
@@ -509,7 +509,7 @@ DankPopout {
|
||||
width: (parent.width - Theme.spacingS * 2) / 3
|
||||
height: 48
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
color: Theme.nestedSurface
|
||||
border.width: 0
|
||||
|
||||
Column {
|
||||
|
||||
@@ -119,7 +119,7 @@ PanelWindow {
|
||||
|
||||
width: Math.min(400, Math.max(180, menuColumn.implicitWidth + Theme.spacingS * 2))
|
||||
height: Math.max(60, menuColumn.implicitHeight + Theme.spacingS * 2)
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
color: Theme.floatingSurface
|
||||
radius: Theme.cornerRadius
|
||||
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
|
||||
|
||||
@@ -42,19 +42,26 @@ BasePill {
|
||||
const active = ToplevelManager.activeToplevel;
|
||||
|
||||
if (!active) {
|
||||
// Only clear if our tracked window is no longer alive
|
||||
if (activeWindow) {
|
||||
const alive = ToplevelManager.toplevels?.values;
|
||||
if (alive && !Array.from(alive).some(t => t === activeWindow))
|
||||
activeWindow = null;
|
||||
if (CompositorService.isNiri) {
|
||||
if (NiriService.currentOutput === (parentScreen?.name ?? ""))
|
||||
activeWindow = null;
|
||||
} else {
|
||||
const alive = ToplevelManager.toplevels?.values;
|
||||
if (alive && !Array.from(alive).some(t => t === activeWindow))
|
||||
activeWindow = null;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!parentScreen || CompositorService.filterCurrentDisplay([active], parentScreen?.name)?.length > 0) {
|
||||
activeWindow = active;
|
||||
} else if (activeWindow) {
|
||||
const alive = ToplevelManager.toplevels?.values;
|
||||
if (alive && !Array.from(alive).some(t => t === activeWindow))
|
||||
activeWindow = null;
|
||||
}
|
||||
// else: active window is on a different screen so keep the previous value
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
@@ -65,7 +72,8 @@ BasePill {
|
||||
Connections {
|
||||
target: ToplevelManager
|
||||
function onActiveToplevelChanged() {
|
||||
root.updateActiveWindow();
|
||||
if (!CompositorService.isNiri)
|
||||
root.updateActiveWindow();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,6 +84,16 @@ BasePill {
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: CompositorService.isNiri ? NiriService : null
|
||||
function onWindowsChanged() {
|
||||
root.updateActiveWindow();
|
||||
}
|
||||
function onCurrentOutputChanged() {
|
||||
root.updateActiveWindow();
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: DesktopEntries
|
||||
function onApplicationsChanged() {
|
||||
@@ -107,21 +125,17 @@ BasePill {
|
||||
}
|
||||
readonly property bool hasWindowsOnCurrentWorkspace: {
|
||||
if (CompositorService.isNiri) {
|
||||
let currentWorkspaceId = null;
|
||||
for (var i = 0; i < NiriService.allWorkspaces.length; i++) {
|
||||
const ws = NiriService.allWorkspaces[i];
|
||||
if (ws.is_focused) {
|
||||
currentWorkspaceId = ws.id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!currentWorkspaceId) {
|
||||
if (!activeWindow || !(activeWindow.title || activeWindow.appId))
|
||||
return false;
|
||||
}
|
||||
|
||||
const workspaceWindows = NiriService.windows.filter(w => w.workspace_id === currentWorkspaceId);
|
||||
return workspaceWindows.length > 0 && activeWindow && (activeWindow.title || activeWindow.appId);
|
||||
if (NiriService.currentOutput !== (parentScreen?.name ?? ""))
|
||||
return true;
|
||||
const focusedWin = NiriService.windows.find(w => w.is_focused);
|
||||
if (!focusedWin)
|
||||
return false;
|
||||
const screenWsIds = new Set(
|
||||
NiriService.allWorkspaces.filter(ws => ws.output === parentScreen.name).map(ws => ws.id)
|
||||
);
|
||||
return screenWsIds.has(focusedWin.workspace_id);
|
||||
}
|
||||
|
||||
if (CompositorService.isHyprland) {
|
||||
|
||||
@@ -152,6 +152,59 @@ BasePill {
|
||||
item: item
|
||||
}))
|
||||
readonly property var hiddenBarItems: allSortedTrayItems.filter(item => SessionData.isHiddenTrayId(root.getTrayItemKey(item)))
|
||||
readonly property string trayIconTintMode: {
|
||||
const configuredMode = SettingsData.systemTrayIconTintMode || "none";
|
||||
switch (configuredMode) {
|
||||
case "monochrome":
|
||||
case "primary":
|
||||
case "secondary":
|
||||
return configuredMode;
|
||||
default:
|
||||
return "none";
|
||||
}
|
||||
}
|
||||
readonly property bool trayIconTintEnabled: trayIconTintMode !== "none"
|
||||
readonly property real trayIconTintSaturationAmount: {
|
||||
const raw = SettingsData.systemTrayIconTintSaturation;
|
||||
const value = (raw === undefined || raw === null) ? 50 : raw;
|
||||
return Math.max(0, Math.min(100, value)) / 100;
|
||||
}
|
||||
readonly property real trayIconTintStrengthAmount: {
|
||||
const raw = SettingsData.systemTrayIconTintStrength;
|
||||
const value = (raw === undefined || raw === null) ? 135 : raw;
|
||||
return Math.max(0, Math.min(200, value)) / 100;
|
||||
}
|
||||
readonly property real trayIconSaturation: {
|
||||
switch (trayIconTintMode) {
|
||||
case "monochrome":
|
||||
return -1;
|
||||
case "primary":
|
||||
case "secondary":
|
||||
return -root.trayIconTintSaturationAmount;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
readonly property real trayIconColorization: {
|
||||
switch (trayIconTintMode) {
|
||||
case "primary":
|
||||
case "secondary":
|
||||
return root.trayIconTintStrengthAmount;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
readonly property color trayIconTintColor: {
|
||||
switch (trayIconTintMode) {
|
||||
case "primary":
|
||||
return Theme.primary;
|
||||
case "secondary":
|
||||
return Theme.secondary;
|
||||
default:
|
||||
return Theme.surfaceText;
|
||||
}
|
||||
}
|
||||
|
||||
readonly property bool reverseInlineHorizontal: !useOverflowPopup && !isVerticalOrientation && section === "right"
|
||||
readonly property bool reverseInlineVertical: !useOverflowPopup && isVerticalOrientation && section === "right"
|
||||
readonly property var displayedMainBarItems: reverseInlineHorizontal ? [...mainBarItems].reverse() : mainBarItems
|
||||
@@ -367,9 +420,11 @@ BasePill {
|
||||
smooth: true
|
||||
mipmap: true
|
||||
visible: status === Image.Ready
|
||||
layer.enabled: SettingsData.systemTrayMonochromeIcons
|
||||
layer.enabled: root.trayIconTintEnabled
|
||||
layer.effect: MultiEffect {
|
||||
saturation: -1
|
||||
saturation: root.trayIconSaturation
|
||||
colorization: root.trayIconColorization
|
||||
colorizationColor: root.trayIconTintColor
|
||||
}
|
||||
}
|
||||
|
||||
@@ -586,9 +641,11 @@ BasePill {
|
||||
smooth: true
|
||||
mipmap: true
|
||||
visible: status === Image.Ready
|
||||
layer.enabled: SettingsData.systemTrayMonochromeIcons
|
||||
layer.enabled: root.trayIconTintEnabled
|
||||
layer.effect: MultiEffect {
|
||||
saturation: -1
|
||||
saturation: root.trayIconSaturation
|
||||
colorization: root.trayIconColorization
|
||||
colorizationColor: root.trayIconTintColor
|
||||
}
|
||||
}
|
||||
|
||||
@@ -718,9 +775,11 @@ BasePill {
|
||||
smooth: true
|
||||
mipmap: true
|
||||
visible: status === Image.Ready
|
||||
layer.enabled: SettingsData.systemTrayMonochromeIcons
|
||||
layer.enabled: root.trayIconTintEnabled
|
||||
layer.effect: MultiEffect {
|
||||
saturation: -1
|
||||
saturation: root.trayIconSaturation
|
||||
colorization: root.trayIconColorization
|
||||
colorizationColor: root.trayIconTintColor
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1178,7 +1237,7 @@ BasePill {
|
||||
targetRadius: Theme.cornerRadius
|
||||
sourceRect.antialiasing: true
|
||||
sourceRect.smooth: true
|
||||
shadowEnabled: Theme.elevationEnabled && SettingsData.popoutElevationEnabled
|
||||
shadowEnabled: Theme.elevationEnabled && SettingsData.popoutElevationEnabled && !BlurService.enabled
|
||||
layer.smooth: true
|
||||
layer.textureSize: Qt.size(Math.round(width * overflowMenu.dpr * 2), Math.round(height * overflowMenu.dpr * 2))
|
||||
layer.textureMirroring: ShaderEffectSource.MirrorVertically
|
||||
@@ -1223,9 +1282,11 @@ BasePill {
|
||||
smooth: true
|
||||
mipmap: true
|
||||
visible: status === Image.Ready
|
||||
layer.enabled: SettingsData.systemTrayMonochromeIcons
|
||||
layer.enabled: root.trayIconTintEnabled
|
||||
layer.effect: MultiEffect {
|
||||
saturation: -1
|
||||
saturation: root.trayIconSaturation
|
||||
colorization: root.trayIconColorization
|
||||
colorizationColor: root.trayIconTintColor
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1627,7 +1688,7 @@ BasePill {
|
||||
targetColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
targetRadius: Theme.cornerRadius
|
||||
sourceRect.antialiasing: true
|
||||
shadowEnabled: Theme.elevationEnabled && SettingsData.popoutElevationEnabled
|
||||
shadowEnabled: Theme.elevationEnabled && SettingsData.popoutElevationEnabled && !BlurService.enabled
|
||||
layer.smooth: true
|
||||
layer.textureSize: Qt.size(Math.round(width * menuWindow.dpr), Math.round(height * menuWindow.dpr))
|
||||
layer.textureMirroring: ShaderEffectSource.MirrorVertically
|
||||
|
||||
Reference in New Issue
Block a user