Add bar position

This commit is contained in:
Ly-sec 2025-08-19 12:52:54 +02:00
parent 1564992442
commit 7b26ddaa32
11 changed files with 72 additions and 14 deletions

View file

@ -90,8 +90,12 @@ NLoader {
property real innerMargin: sidePanel.cardSpacing
// Height scales to content plus vertical padding
height: content.implicitHeight + innerMargin * 2
// Place the panel just below the bar (overlay content starts below bar due to topMargin)
y: Style.marginS * scaling
// Place the panel relative to the bar based on its position
y: Settings.data.bar.barPosition === "top" ? Style.marginS * scaling : undefined
anchors {
bottom: Settings.data.bar.barPosition === "bottom" ? parent.bottom : undefined
bottomMargin: Settings.data.bar.barPosition === "bottom" ? Style.barHeight * scaling + Style.marginS * scaling : undefined
}
// Center horizontally under the anchorX, clamped to the screen bounds
x: Math.max(Style.marginS * scaling, Math.min(parent.width - width - Style.marginS * scaling,
Math.round(anchorX - width / 2)))