1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-27 23:12:49 -05:00

Add FocusedApp compact mode and fix SystemTray to use IconImage

This commit is contained in:
bbedward
2025-08-18 14:14:23 -04:00
parent d638e54ed7
commit b75342bf93
6 changed files with 36 additions and 11 deletions

View File

@@ -6,7 +6,7 @@ import qs.Widgets
Rectangle {
id: root
property bool compactMode: false
property bool compactMode: SettingsData.focusedWindowCompactMode
property int availableWidth: 400
readonly property int baseWidth: contentRow.implicitWidth + Theme.spacingS * 2
readonly property int maxNormalWidth: 456
@@ -48,6 +48,7 @@ Rectangle {
elide: Text.ElideRight
maximumLineCount: 1
width: Math.min(implicitWidth, compactMode ? 80 : 180)
visible: !compactMode && text.length > 0
}
StyledText {
@@ -55,7 +56,7 @@ Rectangle {
font.pixelSize: Theme.fontSizeSmall
color: Theme.outlineButton
anchors.verticalCenter: parent.verticalCenter
visible: appText.text && titleText.text
visible: !compactMode && appText.text && titleText.text
}
StyledText {
@@ -68,7 +69,7 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
elide: Text.ElideRight
maximumLineCount: 1
width: Math.min(implicitWidth, compactMode ? 180 : 250)
width: Math.min(implicitWidth, compactMode ? 280 : 250)
visible: text.length > 0
}
}

View File

@@ -1,6 +1,7 @@
import QtQuick
import Quickshell
import Quickshell.Services.SystemTray
import Quickshell.Widgets
import qs.Common
Rectangle {
@@ -74,14 +75,14 @@ Rectangle {
}
}
Image {
IconImage {
anchors.centerIn: parent
width: 18
height: 18
source: parent.iconSource
asynchronous: true
smooth: true
fillMode: Image.PreserveAspectFit
mipmap: true
}
MouseArea {

View File

@@ -651,7 +651,6 @@ PanelWindow {
id: focusedWindowComponent
FocusedApp {
compactMode: topBarContent.spacingTight
availableWidth: topBarContent.leftToMediaGap
}
}