From 15c0e7f800caeabcb7f161a6020a7bab1e268093 Mon Sep 17 00:00:00 2001 From: Hannes Date: Wed, 18 Feb 2026 19:03:32 +0100 Subject: [PATCH] Changes to size in tray and workspaces --- modules/bar/widgets/Tray.qml | 136 +++++++++++++++-------------- modules/bar/widgets/Workspaces.qml | 2 +- modules/wp/set-wallpaper.sh | 7 +- 3 files changed, 77 insertions(+), 68 deletions(-) diff --git a/modules/bar/widgets/Tray.qml b/modules/bar/widgets/Tray.qml index dc16fe1..783eb3b 100644 --- a/modules/bar/widgets/Tray.qml +++ b/modules/bar/widgets/Tray.qml @@ -11,81 +11,87 @@ Row { // Workspace Row Repeater { model: SystemTray.items - - Rectangle { //trayItem - id: trayItem - width: bar.height - height: bar.height - radius: 4 - color: "transparent" - border.width: 2 - - Process { - id: steamRunner - command: ["steam", "steam://open/main"] - running: false + Column{ + Rectangle{ + width: iconImage.width + 8 + height: (bar.height-trayItem.height)/2 + color: "transparent" } + Rectangle { //trayItem + id: trayItem + width: iconImage.width + 8 + height: iconImage.height + 8 + radius: 4 + color: "transparent" + border.width: 2 - MouseArea { - id: workspaceButton - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - anchors.fill: parent - acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton - onClicked: (mouse) => { - switch (mouse.button) { - case Qt.LeftButton: - if (!modelData.onlyMenu) { - modelData.activate() - console.log('Activcate function of ', modelData.title) - } - if (modelData.title.trim()==="Steam") { - steamRunner.startDetached() - } - break - case Qt.MiddleButton: - modelData.secondaryActivate() - break - // case Qt.RightButton: - // if (modelData.hasMenu) { - // console.log('Activcate menu of ', modelData.title) - // menuAnchor.open() - // } - // break - } + Process { + id: steamRunner + command: ["steam", "steam://open/main"] + running: false } - // QsMenuAnchor { - // id: menuAnchor - // menu: modelData.menu - // anchor.window: menuHost - // } - - Rectangle { + MouseArea { + id: workspaceButton + hoverEnabled: true + cursorShape: Qt.PointingHandCursor anchors.fill: parent - color: workspaceButton.containsMouse ? Colors.tertiaryContainer - : modelData.active ? Colors.primaryContainer - : Colors.secondaryContainer - border.color: workspaceButton.containsMouse ? Colors.tertiaryContainer_fg - : modelData.active ? Colors.primaryContainer_fg - : Colors.secondaryContainer_fg - radius: 6 + acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton + onClicked: (mouse) => { + switch (mouse.button) { + case Qt.LeftButton: + if (!modelData.onlyMenu) { + modelData.activate() + console.log('Activcate function of ', modelData.title) + } + if (modelData.title.trim()==="Steam") { + steamRunner.startDetached() + } + break + case Qt.MiddleButton: + modelData.secondaryActivate() + break + // case Qt.RightButton: + // if (modelData.hasMenu) { + // console.log('Activcate menu of ', modelData.title) + // menuAnchor.open() + // } + // break + } + } + + // QsMenuAnchor { + // id: menuAnchor + // menu: modelData.menu + // anchor.window: menuHost + // } + + Rectangle { + anchors.fill: parent + color: workspaceButton.containsMouse ? Colors.tertiaryContainer + : modelData.active ? Colors.primaryContainer + : Colors.secondaryContainer + border.color: workspaceButton.containsMouse ? Colors.tertiaryContainer_fg + : modelData.active ? Colors.primaryContainer_fg + : Colors.secondaryContainer_fg + radius: 6 + } + } - } + Image { // Image + id: iconImage + source: modelData.icon + fillMode: Image.PreserveAspectCrop - Image { // Image - id: iconImage - source: modelData.icon - fillMode: Image.PreserveAspectCrop + anchors.centerIn: parent - anchors.centerIn: parent + width: bar.height*0.5 + height: bar.height*0.5 - width: bar.height*0.75 - height: bar.height*0.75 - - asynchronous: true - cache: true + asynchronous: true + cache: true + } } } } diff --git a/modules/bar/widgets/Workspaces.qml b/modules/bar/widgets/Workspaces.qml index 5a35069..cb99016 100644 --- a/modules/bar/widgets/Workspaces.qml +++ b/modules/bar/widgets/Workspaces.qml @@ -14,7 +14,7 @@ Row { // Workspace Row Rectangle { //workspace visible: modelData.monitor === thisMonitor - width: workspaceNum.width + 26 + width: (workspaceNum.width + 16) < (workspaceNum.height + 8) ? workspaceNum.height + 8 : workspaceNum.width + 16 height: workspaceNum.height + 8 radius: 4 color: workspaceButton.containsMouse ? Colors.tertiaryContainer diff --git a/modules/wp/set-wallpaper.sh b/modules/wp/set-wallpaper.sh index a5ac368..a2301dd 100755 --- a/modules/wp/set-wallpaper.sh +++ b/modules/wp/set-wallpaper.sh @@ -62,8 +62,11 @@ echo "$image" > $current_wallpaper blurred_wp="$static_wallpaper_dir/blurred.jpg" -magick $image -blur $blur $blurred_wp - +if [ -x "/usr/bin/sddm" ]; then + magick $image -blur $blur $blurred_wp +else + cp $image $blurred_wp +fi if [ -x "/usr/bin/sddm" ] && [ -d "/usr/share/backgrounds" ]; then sddm_background="/usr/share/backgrounds/background.jpg" cp "$image" "$sddm_background"