window title width fixed
This commit is contained in:
+11
-6
@@ -11,12 +11,15 @@ Item {
|
|||||||
required property var bar
|
required property var bar
|
||||||
property color colour: DynamicColors.palette.m3primary
|
property color colour: DynamicColors.palette.m3primary
|
||||||
property Title current: text1
|
property Title current: text1
|
||||||
readonly property int maxWidth: 300
|
// readonly property int maxWidth: 300
|
||||||
// readonly property int maxWidth: {
|
readonly property int maxWidth: {
|
||||||
// const otherModules = bar.children.filter(c => c.id && c.item !== this && c.id !== "spacer");
|
const otherModules = bar.children.filter(c => c.enabled && c.id && c.item !== this && c.id !== "spacer");
|
||||||
// const otherWidth = otherModules.reduce((acc, curr) => acc + (curr.item.nonAnimWidth ?? curr.width), 0);
|
otherModules.forEach(m => console.log(m.id, m.item));
|
||||||
// return bar.width - otherWidth - bar.spacing * (bar.children.length - 1) - bar.hPadding * 2;
|
const otherWidth = otherModules.reduce((acc, curr) => {
|
||||||
// }
|
return acc + (curr.item?.nonAnimWidth ?? curr.width ?? 0);
|
||||||
|
}, 0);
|
||||||
|
return bar.width - otherWidth - bar.spacing * (bar.children.length - 1) - bar.vPadding * 2;
|
||||||
|
}
|
||||||
required property Brightness.Monitor monitor
|
required property Brightness.Monitor monitor
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
@@ -43,6 +46,8 @@ Item {
|
|||||||
TextMetrics {
|
TextMetrics {
|
||||||
id: metrics
|
id: metrics
|
||||||
|
|
||||||
|
elide: Qt.ElideRight
|
||||||
|
elideWidth: root.maxWidth
|
||||||
font.family: "Rubik"
|
font.family: "Rubik"
|
||||||
font.pointSize: 12
|
font.pointSize: 12
|
||||||
text: Hypr.activeToplevel?.title ?? qsTr("Desktop")
|
text: Hypr.activeToplevel?.title ?? qsTr("Desktop")
|
||||||
|
|||||||
Reference in New Issue
Block a user