Changes to size in tray and workspaces

This commit is contained in:
Hannes
2026-02-18 19:03:32 +01:00
parent 2635f64330
commit 15c0e7f800
3 changed files with 77 additions and 68 deletions
+71 -65
View File
@@ -11,81 +11,87 @@ Row { // Workspace Row
Repeater { Repeater {
model: SystemTray.items model: SystemTray.items
Column{
Rectangle { //trayItem Rectangle{
id: trayItem width: iconImage.width + 8
width: bar.height height: (bar.height-trayItem.height)/2
height: bar.height color: "transparent"
radius: 4
color: "transparent"
border.width: 2
Process {
id: steamRunner
command: ["steam", "steam://open/main"]
running: false
} }
Rectangle { //trayItem
id: trayItem
width: iconImage.width + 8
height: iconImage.height + 8
radius: 4
color: "transparent"
border.width: 2
MouseArea { Process {
id: workspaceButton id: steamRunner
hoverEnabled: true command: ["steam", "steam://open/main"]
cursorShape: Qt.PointingHandCursor running: false
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
}
} }
// QsMenuAnchor { MouseArea {
// id: menuAnchor id: workspaceButton
// menu: modelData.menu hoverEnabled: true
// anchor.window: menuHost cursorShape: Qt.PointingHandCursor
// }
Rectangle {
anchors.fill: parent anchors.fill: parent
color: workspaceButton.containsMouse ? Colors.tertiaryContainer acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
: modelData.active ? Colors.primaryContainer onClicked: (mouse) => {
: Colors.secondaryContainer switch (mouse.button) {
border.color: workspaceButton.containsMouse ? Colors.tertiaryContainer_fg case Qt.LeftButton:
: modelData.active ? Colors.primaryContainer_fg if (!modelData.onlyMenu) {
: Colors.secondaryContainer_fg modelData.activate()
radius: 6 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 anchors.centerIn: parent
id: iconImage
source: modelData.icon
fillMode: Image.PreserveAspectCrop
anchors.centerIn: parent width: bar.height*0.5
height: bar.height*0.5
width: bar.height*0.75 asynchronous: true
height: bar.height*0.75 cache: true
}
asynchronous: true
cache: true
} }
} }
} }
+1 -1
View File
@@ -14,7 +14,7 @@ Row { // Workspace Row
Rectangle { //workspace Rectangle { //workspace
visible: modelData.monitor === thisMonitor 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 height: workspaceNum.height + 8
radius: 4 radius: 4
color: workspaceButton.containsMouse ? Colors.tertiaryContainer color: workspaceButton.containsMouse ? Colors.tertiaryContainer
+5 -2
View File
@@ -62,8 +62,11 @@ echo "$image" > $current_wallpaper
blurred_wp="$static_wallpaper_dir/blurred.jpg" 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 if [ -x "/usr/bin/sddm" ] && [ -d "/usr/share/backgrounds" ]; then
sddm_background="/usr/share/backgrounds/background.jpg" sddm_background="/usr/share/backgrounds/background.jpg"
cp "$image" "$sddm_background" cp "$image" "$sddm_background"