fix text overflow from Title

This commit is contained in:
lucy 2026-01-18 13:37:04 +01:00
parent e08b910471
commit 4ad47093e6
3 changed files with 11 additions and 10 deletions

View File

@ -6,12 +6,14 @@ import Quickshell.Hyprland
Item { Item {
id: root id: root
readonly property var activeWindow: Hyprland.activeToplevel readonly property var activeWindow: Hyprland.activeToplevel
implicitWidth: text.implicitWidth implicitWidth: Math.min(text.implicitWidth, 500)
implicitHeight: Settings.config.barHeight implicitHeight: Settings.config.barHeight
CustomText { CustomText {
anchors.left: parent.left
anchors.right: parent.right
id: text id: text
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: root.activeWindow ? Hyprland.activeToplevel.title : "Desktop" text: root.activeWindow ? Hyprland.activeToplevel.title : "Desktop"
elide: Text.ElideRight
} }
} }

View File

@ -18,4 +18,8 @@ Item {
command: ["sh", "-c", cmd] command: ["sh", "-c", cmd]
onStarted: console.log("started wallust runner" + command) onStarted: console.log("started wallust runner" + command)
} }
Process {
id: kittyKiller
command: ["sh", "-c", "pkill", "-SIGUSR1", "kitty"]
}
} }

View File

@ -8,6 +8,7 @@ import "../../"
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell.Widgets import Quickshell.Widgets
import "../../settings/" import "../../settings/"
import "../../reusables/"
Variants { Variants {
model: Quickshell.screens model: Quickshell.screens
@ -93,23 +94,17 @@ Variants {
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
spacing: 2 spacing: 2
Text { CustomText {
text: notifyItem.modelData.summary text: notifyItem.modelData.summary
color: Colors.foreground
font.family: Settings.config.font
font.pixelSize: Settings.config.fontSize
font.bold: true font.bold: true
elide: Text.ElideRight elide: Text.ElideRight
Layout.fillWidth: true Layout.fillWidth: true
onTextChanged: dismissTimer.restart() onTextChanged: dismissTimer.restart()
} }
Text { CustomText {
text: notifyItem.modelData.body text: notifyItem.modelData.body
color: Colors.foreground
font.family: Settings.config.font
font.pixelSize: Settings.config.fontSize - 2
maximumLineCount: 3 maximumLineCount: 3
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
elide: Text.ElideRight elide: Text.ElideRight