1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-05 04:58:30 -04:00

feat(Settings): add option to show icon for focused windows

- Closes #2122
This commit is contained in:
purian23
2026-07-04 18:42:40 -04:00
parent c0e7c1b2b4
commit 187b7ba8ff
5 changed files with 220 additions and 3 deletions
@@ -15,6 +15,7 @@ BasePill {
property var widgetData: null
property bool compactMode: widgetData?.focusedWindowCompactMode !== undefined ? widgetData.focusedWindowCompactMode : SettingsData.focusedWindowCompactMode
property bool showIcon: widgetData?.focusedWindowShowIcon !== undefined ? widgetData.focusedWindowShowIcon : SettingsData.focusedWindowShowIcon
readonly property int maxWidth: {
const size = widgetData?.focusedWindowSize !== undefined ? widgetData.focusedWindowSize : SettingsData.focusedWindowSize;
switch (size) {
@@ -239,6 +240,37 @@ BasePill {
spacing: Theme.spacingS
visible: !root.isVerticalOrientation
IconImage {
id: horizontalAppIcon
Layout.preferredWidth: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
Layout.preferredHeight: Layout.preferredWidth
visible: root.showIcon && activeWindow && status === Image.Ready
source: {
if (!activeWindow || !activeWindow.appId)
return "";
return Paths.getAppIcon(activeWindow.appId, activeDesktopEntry);
}
smooth: true
mipmap: true
asynchronous: true
layer.enabled: activeWindow && (activeWindow.appId === "org.quickshell" || activeWindow.appId === "com.danklinux.dms")
layer.smooth: true
layer.mipmap: true
layer.effect: MultiEffect {
saturation: 0
colorization: 1
colorizationColor: Theme.primary
}
}
DankIcon {
Layout.preferredWidth: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
size: Layout.preferredWidth
name: "sports_esports"
color: Theme.widgetTextColor
visible: root.showIcon && activeWindow && activeWindow.appId && horizontalAppIcon.status !== Image.Ready && Paths.isSteamApp(activeWindow.appId)
}
StyledText {
id: appText
text: {