Bar: add floating setting

This commit is contained in:
Ly-sec 2025-09-13 10:11:57 +02:00
parent ae931b791f
commit 50d8b54adf
4 changed files with 216 additions and 1 deletions

View file

@ -86,6 +86,202 @@ ColumnLayout {
}
}
}
NToggle {
Layout.fillWidth: true
label: "Floating Bar"
description: "Make the bar float with rounded corners and margins. This will hide screen corners."
checked: Settings.data.bar.floating
onToggled: checked => Settings.data.bar.floating = checked
}
// Floating bar options - only show when floating is enabled
ColumnLayout {
visible: Settings.data.bar.floating
spacing: Style.marginXXS * scaling
Layout.fillWidth: true
NText {
text: "Rounding"
font.pointSize: Style.fontSizeL * scaling
font.weight: Style.fontWeightBold
color: Color.mOnSurface
}
NText {
text: "Adjust the corner rounding of the floating bar."
font.pointSize: Style.fontSizeXS * scaling
color: Color.mOnSurfaceVariant
wrapMode: Text.WordWrap
Layout.fillWidth: true
}
RowLayout {
NSlider {
Layout.fillWidth: true
from: 0
to: 50
stepSize: 1
value: Settings.data.bar.rounding
onMoved: Settings.data.bar.rounding = value
cutoutColor: Color.mSurface
}
NText {
text: Math.round(Settings.data.bar.rounding) + "px"
Layout.alignment: Qt.AlignVCenter
Layout.leftMargin: Style.marginS * scaling
Layout.preferredWidth: 50
horizontalAlignment: Text.AlignRight
color: Color.mOnSurface
}
}
NText {
text: "Margins"
font.pointSize: Style.fontSizeL * scaling
font.weight: Style.fontWeightBold
color: Color.mOnSurface
Layout.topMargin: Style.marginM * scaling
}
NText {
text: "Adjust the margins around the floating bar."
font.pointSize: Style.fontSizeXS * scaling
color: Color.mOnSurfaceVariant
wrapMode: Text.WordWrap
Layout.fillWidth: true
}
GridLayout {
columns: 2
Layout.fillWidth: true
rowSpacing: Style.marginS * scaling
columnSpacing: Style.marginS * scaling
ColumnLayout {
spacing: Style.marginXXS * scaling
NText {
text: "Top"
font.pointSize: Style.fontSizeXS * scaling
color: Color.mOnSurfaceVariant
}
RowLayout {
NSlider {
Layout.fillWidth: true
from: 0
to: 50
stepSize: 1
value: Settings.data.bar.marginTop
onMoved: Settings.data.bar.marginTop = value
cutoutColor: Color.mSurface
}
NText {
text: Math.round(Settings.data.bar.marginTop) + "px"
Layout.alignment: Qt.AlignVCenter
Layout.leftMargin: Style.marginXS * scaling
color: Color.mOnSurface
}
}
}
ColumnLayout {
spacing: Style.marginXXS * scaling
NText {
text: "Bottom"
font.pointSize: Style.fontSizeXS * scaling
color: Color.mOnSurfaceVariant
}
RowLayout {
NSlider {
Layout.fillWidth: true
from: 0
to: 50
stepSize: 1
value: Settings.data.bar.marginBottom
onMoved: Settings.data.bar.marginBottom = value
cutoutColor: Color.mSurface
}
NText {
text: Math.round(Settings.data.bar.marginBottom) + "px"
Layout.alignment: Qt.AlignVCenter
Layout.leftMargin: Style.marginXS * scaling
Layout.preferredWidth: 50
horizontalAlignment: Text.AlignRight
color: Color.mOnSurface
}
}
}
ColumnLayout {
spacing: Style.marginXXS * scaling
NText {
text: "Left"
font.pointSize: Style.fontSizeXS * scaling
color: Color.mOnSurfaceVariant
}
RowLayout {
NSlider {
Layout.fillWidth: true
from: 0
to: 50
stepSize: 1
value: Settings.data.bar.marginLeft
onMoved: Settings.data.bar.marginLeft = value
cutoutColor: Color.mSurface
}
NText {
text: Math.round(Settings.data.bar.marginLeft) + "px"
Layout.alignment: Qt.AlignVCenter
Layout.leftMargin: Style.marginXS * scaling
Layout.preferredWidth: 50
horizontalAlignment: Text.AlignRight
color: Color.mOnSurface
}
}
}
ColumnLayout {
spacing: Style.marginXXS * scaling
NText {
text: "Right"
font.pointSize: Style.fontSizeXS * scaling
color: Color.mOnSurfaceVariant
}
RowLayout {
NSlider {
Layout.fillWidth: true
from: 0
to: 50
stepSize: 1
value: Settings.data.bar.marginRight
onMoved: Settings.data.bar.marginRight = value
cutoutColor: Color.mSurface
}
NText {
text: Math.round(Settings.data.bar.marginRight) + "px"
Layout.alignment: Qt.AlignVCenter
Layout.leftMargin: Style.marginXS * scaling
Layout.preferredWidth: 50
horizontalAlignment: Text.AlignRight
color: Color.mOnSurface
}
}
}
}
}
}
NDivider {