mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-02 10:32:07 -04:00
Compare commits
4 Commits
997011e008
...
59451890f1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59451890f1 | ||
|
|
e633c9e039 | ||
|
|
6c1fff2df1 | ||
|
|
3891d125d1 |
@@ -70,6 +70,16 @@ DankPopout {
|
||||
|
||||
backgroundInteractive: !anyModalOpen
|
||||
|
||||
onCredentialsPromptOpenChanged: {
|
||||
if (credentialsPromptOpen && shouldBeVisible)
|
||||
close();
|
||||
}
|
||||
|
||||
onPolkitModalOpenChanged: {
|
||||
if (polkitModalOpen && shouldBeVisible)
|
||||
close();
|
||||
}
|
||||
|
||||
customKeyboardFocus: {
|
||||
if (!shouldBeVisible)
|
||||
return WlrKeyboardFocus.None;
|
||||
|
||||
@@ -275,7 +275,7 @@ PanelWindow {
|
||||
const onThisScreen = bc.screenPreferences.includes(screenName) || bc.screenPreferences.length === 0 || bc.screenPreferences.includes("all");
|
||||
if (!onThisScreen)
|
||||
return false;
|
||||
if (bc.showOnLastDisplay && screenName !== barWindow.screen.name)
|
||||
if (bc.showOnLastDisplay && screenName !== barWindow.screenName)
|
||||
return false;
|
||||
return true;
|
||||
});
|
||||
@@ -298,7 +298,7 @@ PanelWindow {
|
||||
const onThisScreen = bc.screenPreferences.includes(screenName) || bc.screenPreferences.length === 0 || bc.screenPreferences.includes("all");
|
||||
if (!onThisScreen)
|
||||
return false;
|
||||
if (bc.showOnLastDisplay && screenName !== barWindow.screen.name)
|
||||
if (bc.showOnLastDisplay && screenName !== barWindow.screenName)
|
||||
return false;
|
||||
return true;
|
||||
});
|
||||
@@ -322,7 +322,7 @@ PanelWindow {
|
||||
const onThisScreen = bc.screenPreferences.includes(screenName) || bc.screenPreferences.length === 0 || bc.screenPreferences.includes("all");
|
||||
if (!onThisScreen)
|
||||
return false;
|
||||
if (bc.showOnLastDisplay && screenName !== barWindow.screen.name)
|
||||
if (bc.showOnLastDisplay && screenName !== barWindow.screenName)
|
||||
return false;
|
||||
return true;
|
||||
});
|
||||
@@ -346,7 +346,7 @@ PanelWindow {
|
||||
const onThisScreen = bc.screenPreferences.includes(screenName) || bc.screenPreferences.length === 0 || bc.screenPreferences.includes("all");
|
||||
if (!onThisScreen)
|
||||
return false;
|
||||
if (bc.showOnLastDisplay && screenName !== barWindow.screen.name)
|
||||
if (bc.showOnLastDisplay && screenName !== barWindow.screenName)
|
||||
return false;
|
||||
return true;
|
||||
});
|
||||
@@ -672,6 +672,7 @@ PanelWindow {
|
||||
onHasActivePopoutChanged: evaluateReveal()
|
||||
|
||||
function updateActivePopoutState() {
|
||||
if (!barWindow.screen) return;
|
||||
const screenName = barWindow.screen.name;
|
||||
const activePopout = PopoutManager.currentPopoutsByScreen[screenName];
|
||||
const activeTrayMenu = TrayMenuManager.activeTrayMenus[screenName];
|
||||
|
||||
@@ -378,7 +378,7 @@ BasePill {
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
height: root.vIconSize + (root.showAudioPercent ? audioPercentV.implicitHeight + 2 : 0)
|
||||
height: root.vIconSize + (audioPercentV.visible ? audioPercentV.implicitHeight + 2 : 0)
|
||||
visible: root.showAudioIcon
|
||||
|
||||
DankIcon {
|
||||
@@ -392,7 +392,7 @@ BasePill {
|
||||
|
||||
StyledText {
|
||||
id: audioPercentV
|
||||
visible: root.showAudioPercent
|
||||
visible: root.showAudioPercent && isFinite(AudioService.sink?.audio?.volume)
|
||||
text: Math.round((AudioService.sink?.audio?.volume ?? 0) * 100) + "%"
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
@@ -404,7 +404,7 @@ BasePill {
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
height: root.vIconSize + (root.showMicPercent ? micPercentV.implicitHeight + 2 : 0)
|
||||
height: root.vIconSize + (micPercentV.visible ? micPercentV.implicitHeight + 2 : 0)
|
||||
visible: root.showMicIcon
|
||||
|
||||
DankIcon {
|
||||
@@ -418,7 +418,7 @@ BasePill {
|
||||
|
||||
StyledText {
|
||||
id: micPercentV
|
||||
visible: root.showMicPercent
|
||||
visible: root.showMicPercent && isFinite(AudioService.source?.audio?.volume)
|
||||
text: Math.round((AudioService.source?.audio?.volume ?? 0) * 100) + "%"
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
@@ -430,7 +430,7 @@ BasePill {
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
height: root.vIconSize + (root.showBrightnessPercent ? brightnessPercentV.implicitHeight + 2 : 0)
|
||||
height: root.vIconSize + (brightnessPercentV.visible ? brightnessPercentV.implicitHeight + 2 : 0)
|
||||
visible: root.showBrightnessIcon && DisplayService.brightnessAvailable && root.hasPinnedBrightnessDevice()
|
||||
|
||||
DankIcon {
|
||||
@@ -444,7 +444,7 @@ BasePill {
|
||||
|
||||
StyledText {
|
||||
id: brightnessPercentV
|
||||
visible: root.showBrightnessPercent
|
||||
visible: root.showBrightnessPercent && isFinite(getBrightness())
|
||||
text: Math.round(getBrightness() * 100) + "%"
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
@@ -554,7 +554,7 @@ BasePill {
|
||||
|
||||
StyledText {
|
||||
id: audioPercent
|
||||
visible: root.showAudioPercent
|
||||
visible: root.showAudioPercent && isFinite(AudioService.sink?.audio?.volume)
|
||||
text: Math.round((AudioService.sink?.audio?.volume ?? 0) * 100) + "%"
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
@@ -583,7 +583,7 @@ BasePill {
|
||||
|
||||
StyledText {
|
||||
id: micPercent
|
||||
visible: root.showMicPercent
|
||||
visible: root.showMicPercent && isFinite(AudioService.source?.audio?.volume)
|
||||
text: Math.round((AudioService.source?.audio?.volume ?? 0) * 100) + "%"
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
@@ -612,7 +612,7 @@ BasePill {
|
||||
|
||||
StyledText {
|
||||
id: brightnessPercent
|
||||
visible: root.showBrightnessPercent
|
||||
visible: root.showBrightnessPercent && isFinite(getBrightness())
|
||||
text: Math.round(getBrightness() * 100) + "%"
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.widgetTextColor
|
||||
|
||||
@@ -87,11 +87,11 @@ BasePill {
|
||||
}
|
||||
|
||||
const workspaceWindows = NiriService.windows.filter(w => w.workspace_id === currentWorkspaceId);
|
||||
return workspaceWindows.length > 0 && activeWindow && activeWindow.title;
|
||||
return workspaceWindows.length > 0 && activeWindow && (activeWindow.title || activeWindow.appId);
|
||||
}
|
||||
|
||||
if (CompositorService.isHyprland) {
|
||||
if (!Hyprland.focusedWorkspace || !activeWindow || !activeWindow.title) {
|
||||
if (!Hyprland.focusedWorkspace || !activeWindow || !(activeWindow.title || activeWindow.appId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ BasePill {
|
||||
}
|
||||
}
|
||||
|
||||
return activeWindow && activeWindow.title;
|
||||
return activeWindow && (activeWindow.title || activeWindow.appId);
|
||||
}
|
||||
|
||||
width: hasWindowsOnCurrentWorkspace ? (isVerticalOrientation ? barThickness : visualWidth) : 0
|
||||
@@ -211,17 +211,20 @@ BasePill {
|
||||
text: {
|
||||
const title = activeWindow && activeWindow.title ? activeWindow.title : "";
|
||||
const appName = appText.text;
|
||||
if (!title || !appName) {
|
||||
|
||||
if (compactMode) {
|
||||
if (!title || title === appName)
|
||||
return title || appName;
|
||||
if (title.endsWith(appName))
|
||||
return title.substring(0, title.length - appName.length).replace(/ (-|—) $/, "") || appName;
|
||||
return title;
|
||||
}
|
||||
|
||||
if (title.endsWith(" - " + appName)) {
|
||||
return title.substring(0, title.length - (" - " + appName).length);
|
||||
}
|
||||
if (!title || !appName)
|
||||
return title;
|
||||
|
||||
if (title.endsWith(appName)) {
|
||||
return title.substring(0, title.length - appName.length).replace(/ - $/, "");
|
||||
}
|
||||
if (title.endsWith(appName))
|
||||
return title.substring(0, title.length - appName.length).replace(/ (-|—) $/, "");
|
||||
|
||||
return title;
|
||||
}
|
||||
|
||||
@@ -407,8 +407,8 @@ Item {
|
||||
visible: false
|
||||
x: contentContainer.x - root.shadowBuffer
|
||||
y: contentContainer.y - root.shadowBuffer
|
||||
width: root.alignedWidth + root.shadowBuffer * 2
|
||||
height: root.alignedHeight + root.shadowBuffer * 2
|
||||
width: shouldBeVisible ? root.alignedWidth + root.shadowBuffer * 2 : 0
|
||||
height: shouldBeVisible ? root.alignedHeight + root.shadowBuffer * 2 : 0
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
|
||||
Reference in New Issue
Block a user