generated from wm-packages/pika-hyprland-settings
Refactor Topbar and ActiveWindow layouts: enhance flexibility by removing width constraints and centering items appropriately
This commit is contained in:
parent
60025be0c9
commit
29f1ce6b3d
@ -66,13 +66,10 @@ PanelWindow {
|
||||
Layout.fillHeight: true
|
||||
|
||||
RowLayout {
|
||||
anchors.centerIn: parent
|
||||
width: parent.width
|
||||
anchors.fill: parent
|
||||
|
||||
Widgets.ActiveWindow {
|
||||
Layout.fillWidth: true
|
||||
maxWidth: panel.width / 3
|
||||
Layout.maximumWidth: parent.width
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,8 +7,6 @@ import "root:/"
|
||||
|
||||
BarWidget {
|
||||
id: wrapper
|
||||
property int maxWidth: 100
|
||||
Layout.fillWidth: true
|
||||
|
||||
function getIcon() {
|
||||
var icon = Quickshell.iconPath(ToplevelManager.activeToplevel.appId.toLowerCase(), true);
|
||||
@ -26,26 +24,22 @@ BarWidget {
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
width: parent.width
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.min(implicitWidth, parent.width)
|
||||
height: parent.height
|
||||
spacing: 4
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: parent.width / 2
|
||||
}
|
||||
|
||||
IconImage {
|
||||
id: icon
|
||||
implicitHeight: 20
|
||||
implicitWidth: 20
|
||||
source: ToplevelManager.activeToplevel ? getIcon() : ""
|
||||
source: ToplevelManager.activeToplevel ? getIcon() : ""
|
||||
}
|
||||
|
||||
Text {
|
||||
id: text
|
||||
Layout.fillWidth: false
|
||||
Layout.maximumWidth: wrapper.maxWidth - icon.implicitWidth - 32
|
||||
Layout.fillWidth: true
|
||||
Layout.maximumWidth: implicitWidth + 1
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
text: ToplevelManager.activeToplevel?.title ?? ""
|
||||
color: Globals.commonStyles.textColor
|
||||
@ -55,10 +49,5 @@ BarWidget {
|
||||
elide: Text.ElideRight
|
||||
maximumLineCount: 1
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: parent.width / 2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user