31 lines
810 B
QML
31 lines
810 B
QML
// modules/WindowTitleWidget.qml - hyprland/window equivalent
|
|
import QtQuick
|
|
import Quickshell.Hyprland
|
|
import ".."
|
|
|
|
Pill {
|
|
id: root
|
|
required property var screen
|
|
|
|
clip: true
|
|
|
|
Behavior on implicitWidth {
|
|
NumberAnimation { duration: 250; easing.type: Easing.InOutCubic }
|
|
}
|
|
|
|
readonly property string displayTitle: {
|
|
let rawTitle = Hyprland.activeToplevel ? Hyprland.activeToplevel.title : "";
|
|
if (rawTitle.length > 45) {
|
|
return rawTitle.substring(0, Theme.titleLength) + "...";
|
|
}
|
|
return rawTitle;
|
|
}
|
|
Text {
|
|
text: root.displayTitle
|
|
font { family: Theme.fontSans; pixelSize: Theme.fontSize }
|
|
color: Theme.pillText
|
|
elide: Text.ElideRight
|
|
maximumLineCount: 1
|
|
}
|
|
}
|