Bar: reimplemented hairline gap safety.

This commit is contained in:
ItsLemmy
2025-11-11 06:21:58 -05:00
parent 38da6dbfcf
commit 877f517a02
3 changed files with 16 additions and 38 deletions
+5 -28
View File
@@ -27,8 +27,6 @@ Item {
readonly property string barPosition: Settings.data.bar.position || "top"
readonly property bool barIsVertical: barPosition === "left" || barPosition === "right"
readonly property bool barFloating: Settings.data.bar.floating || false
readonly property real barMarginH: 0 //barFloating ? Settings.data.bar.marginHorizontal * Style.marginXL : 0
readonly property real barMarginV: 0 //barFloating ? Settings.data.bar.marginVertical * Style.marginXL : 0
// Fill the parent (the Loader)
anchors.fill: parent
@@ -38,7 +36,6 @@ Item {
if (screen && screen.name) {
Logger.d("Bar", "Bar screen set to:", screen.name)
Logger.d("Bar", " Position:", barPosition, "Floating:", barFloating)
Logger.d("Bar", " Margins - H:", barMarginH, "V:", barMarginV)
BarService.registerBar(screen.name)
}
}
@@ -64,31 +61,11 @@ Item {
Item {
id: bar
// Position and size the bar based on orientation and floating margins
x: {
var baseX = (root.barPosition === "right") ? (parent.width - Style.barHeight - root.barMarginH) : root.barMarginH
if (root.barPosition === "right")
return baseX // Extend left towards panels
return baseX
}
y: {
var baseY = (root.barPosition === "bottom") ? (parent.height - Style.barHeight - root.barMarginV) : root.barMarginV
if (root.barPosition === "bottom")
return baseY // Extend up towards panels
return baseY
}
width: {
var baseWidth = root.barIsVertical ? Style.barHeight : (parent.width - root.barMarginH * 2)
if (!root.barIsVertical)
return baseWidth // Horizontal bars extend via height, not width
return baseWidth + 1
}
height: {
var baseHeight = root.barIsVertical ? (parent.height - root.barMarginV * 2) : Style.barHeight
if (!root.barIsVertical)
return baseHeight
return baseHeight // Vertical bars extend via width, not height
}
// Position and size the bar content based on orientation
x: (root.barPosition === "right") ? (parent.width - Style.barHeight) : 0.5
y: (root.barPosition === "bottom") ? (parent.height - Style.barHeight) : 0.5
width: root.barIsVertical ? Style.barHeight : parent.width
height: root.barIsVertical ? parent.height : Style.barHeight
// Corner states for new unified background system
// State -1: No radius (flat/square corner)