bar: add bottom position

This commit is contained in:
end-4
2025-05-30 22:41:50 +02:00
parent e119d6d582
commit 47a34dc76b
6 changed files with 34 additions and 14 deletions
+17 -9
View File
@@ -46,16 +46,20 @@ Scope {
color: "transparent" color: "transparent"
anchors { anchors {
top: true top: !ConfigOptions.bar.bottom
bottom: ConfigOptions.bar.bottom
left: true left: true
right: true right: true
} }
Rectangle { // Bar background Rectangle { // Bar background
id: barContent id: barContent
anchors.right: parent.right anchors {
anchors.left: parent.left right: parent.right
anchors.top: parent.top left: parent.left
top: !ConfigOptions.bar.bottom ? parent.top : undefined
bottom: ConfigOptions.bar.bottom ? parent.bottom : undefined
}
color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" color: showBarBackground ? Appearance.colors.colLayer0 : "transparent"
height: barHeight height: barHeight
@@ -425,23 +429,27 @@ Scope {
// Round decorators // Round decorators
Item { Item {
anchors.left: parent.left anchors {
anchors.right: parent.right left: parent.left
anchors.top: barContent.bottom right: parent.right
// top: barContent.bottom
top: ConfigOptions.bar.bottom ? undefined : barContent.bottom
bottom: ConfigOptions.bar.bottom ? barContent.top : undefined
}
height: Appearance.rounding.screenRounding height: Appearance.rounding.screenRounding
RoundCorner { RoundCorner {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
size: Appearance.rounding.screenRounding size: Appearance.rounding.screenRounding
corner: cornerEnum.topLeft corner: ConfigOptions.bar.bottom ? cornerEnum.bottomLeft : cornerEnum.topLeft
color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" color: showBarBackground ? Appearance.colors.colLayer0 : "transparent"
} }
RoundCorner { RoundCorner {
anchors.top: parent.top anchors.top: parent.top
anchors.right: parent.right anchors.right: parent.right
size: Appearance.rounding.screenRounding size: Appearance.rounding.screenRounding
corner: cornerEnum.topRight corner: ConfigOptions.bar.bottom ? cornerEnum.bottomRight : cornerEnum.topRight
color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" color: showBarBackground ? Appearance.colors.colLayer0 : "transparent"
} }
} }
@@ -22,10 +22,11 @@ Singleton {
} }
property QtObject bar: QtObject { property QtObject bar: QtObject {
property bool bottom: false // Instead of top
property bool borderless: true
property int batteryLowThreshold: 20 property int batteryLowThreshold: 20
property string topLeftIcon: "spark" // Options: distro, spark property string topLeftIcon: "spark" // Options: distro, spark
property bool showBackground: true property bool showBackground: true
property bool borderless: false
property QtObject resources: QtObject { property QtObject resources: QtObject {
property bool alwaysShowSwap: true property bool alwaysShowSwap: true
property bool alwaysShowCpu: false property bool alwaysShowCpu: false
@@ -87,7 +87,8 @@ Scope {
WlrLayershell.namespace: "quickshell:mediaControls" WlrLayershell.namespace: "quickshell:mediaControls"
anchors { anchors {
top: true top: !ConfigOptions.bar.bottom
bottom: ConfigOptions.bar.bottom
left: true left: true
} }
mask: Region { mask: Region {
@@ -65,7 +65,10 @@ Scope {
WlrLayershell.layer: WlrLayer.Overlay WlrLayershell.layer: WlrLayer.Overlay
color: "transparent" color: "transparent"
anchors.top: true anchors {
top: !ConfigOptions.bar.bottom
bottom: ConfigOptions.bar.bottom
}
mask: Region { mask: Region {
item: osdValuesWrapper item: osdValuesWrapper
} }
@@ -67,7 +67,10 @@ Scope {
WlrLayershell.layer: WlrLayer.Overlay WlrLayershell.layer: WlrLayer.Overlay
color: "transparent" color: "transparent"
anchors.top: true anchors {
top: !ConfigOptions.bar.bottom
bottom: ConfigOptions.bar.bottom
}
mask: Region { mask: Region {
item: osdValuesWrapper item: osdValuesWrapper
} }
@@ -90,7 +90,11 @@ Scope {
ColumnLayout { ColumnLayout {
id: columnLayout id: columnLayout
visible: GlobalStates.overviewOpen visible: GlobalStates.overviewOpen
anchors.horizontalCenter: parent.horizontalCenter anchors {
horizontalCenter: parent.horizontalCenter
top: !ConfigOptions.bar.bottom ? parent.top : null
bottom: ConfigOptions.bar.bottom ? parent.bottom : null
}
Keys.onPressed: (event) => { Keys.onPressed: (event) => {
if (event.key === Qt.Key_Escape) { if (event.key === Qt.Key_Escape) {