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
|
Layout.fillHeight: true
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
anchors.centerIn: parent
|
anchors.fill: parent
|
||||||
width: parent.width
|
|
||||||
|
|
||||||
Widgets.ActiveWindow {
|
Widgets.ActiveWindow {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
maxWidth: panel.width / 3
|
|
||||||
Layout.maximumWidth: parent.width
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,8 +7,6 @@ import "root:/"
|
|||||||
|
|
||||||
BarWidget {
|
BarWidget {
|
||||||
id: wrapper
|
id: wrapper
|
||||||
property int maxWidth: 100
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
function getIcon() {
|
function getIcon() {
|
||||||
var icon = Quickshell.iconPath(ToplevelManager.activeToplevel.appId.toLowerCase(), true);
|
var icon = Quickshell.iconPath(ToplevelManager.activeToplevel.appId.toLowerCase(), true);
|
||||||
@ -26,26 +24,22 @@ BarWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
width: parent.width
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
width: Math.min(implicitWidth, parent.width)
|
||||||
height: parent.height
|
height: parent.height
|
||||||
spacing: 4
|
spacing: 4
|
||||||
|
|
||||||
Item {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.preferredWidth: parent.width / 2
|
|
||||||
}
|
|
||||||
|
|
||||||
IconImage {
|
IconImage {
|
||||||
id: icon
|
id: icon
|
||||||
implicitHeight: 20
|
implicitHeight: 20
|
||||||
implicitWidth: 20
|
implicitWidth: 20
|
||||||
source: ToplevelManager.activeToplevel ? getIcon() : ""
|
source: ToplevelManager.activeToplevel ? getIcon() : ""
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: text
|
id: text
|
||||||
Layout.fillWidth: false
|
Layout.fillWidth: true
|
||||||
Layout.maximumWidth: wrapper.maxWidth - icon.implicitWidth - 32
|
Layout.maximumWidth: implicitWidth + 1
|
||||||
horizontalAlignment: Text.AlignLeft
|
horizontalAlignment: Text.AlignLeft
|
||||||
text: ToplevelManager.activeToplevel?.title ?? ""
|
text: ToplevelManager.activeToplevel?.title ?? ""
|
||||||
color: Globals.commonStyles.textColor
|
color: Globals.commonStyles.textColor
|
||||||
@ -55,10 +49,5 @@ BarWidget {
|
|||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
maximumLineCount: 1
|
maximumLineCount: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.preferredWidth: parent.width / 2
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user