activewindow

This commit is contained in:
Zacharias-Brohn
2026-03-02 20:00:16 +01:00
parent e5595d8b5d
commit 6e967f8fd6
+7 -17
View File
@@ -11,17 +11,17 @@ Item {
required property var bar
property color colour: DynamicColors.palette.m3primary
property Title current: text1
readonly property int maxHeight: {
const otherModules = bar.children.filter(c => c.id && c.item !== this && c.id !== "spacer");
const otherHeight = otherModules.reduce((acc, curr) => acc + (curr.item.nonAnimHeight ?? curr.height), 0);
// Length - 2 cause repeater counts as a child
return bar.height - otherHeight - bar.spacing * (bar.children.length - 1) - bar.vPadding * 2;
}
readonly property int maxWidth: 300
// readonly property int maxWidth: {
// const otherModules = bar.children.filter(c => c.id && c.item !== this && c.id !== "spacer");
// const otherWidth = otherModules.reduce((acc, curr) => acc + (curr.item.nonAnimWidth ?? curr.width), 0);
// return bar.width - otherWidth - bar.spacing * (bar.children.length - 1) - bar.hPadding * 2;
// }
required property Brightness.Monitor monitor
clip: true
implicitHeight: current.implicitHeight
implicitWidth: current.implicitWidth + current.anchors.leftMargin
implicitWidth: Math.min(current.implicitWidth, root.maxWidth)
Behavior on implicitWidth {
Anim {
@@ -30,16 +30,6 @@ Item {
}
}
// MaterialIcon {
// id: icon
//
// anchors.verticalCenter: parent.verticalCenter
//
// animate: true
// text: Icons.getAppCategoryIcon(Hypr.activeToplevel?.lastIpcObject.class, "desktop_windows")
// color: root.colour
// }
Title {
id: text1