feat: add padding setting for the bar

This commit is contained in:
Emre Can Çorapçı
2026-02-23 21:07:38 +03:00
parent 17760955ac
commit d1100bd03d
5 changed files with 23 additions and 5 deletions
+2
View File
@@ -830,6 +830,8 @@
"appearance-use-separate-opacity-label": "Use separate bar opacity",
"appearance-widget-spacing-description": "Adjust the spacing between each widget in the bar.",
"appearance-widget-spacing-label": "Widget spacing",
"appearance-content-padding-description": "Adjust the padding between bar edges and widgets.",
"appearance-content-padding-label": "Content padding",
"monitor-configure-widgets": "Configure widgets",
"monitor-override-settings": "Override global settings",
"monitor-override-settings-description": "Use custom settings for this monitor.",
+2 -1
View File
@@ -10,6 +10,7 @@
"capsuleOpacity": 1,
"capsuleColorKey": "none",
"widgetSpacing": 6,
"contentPadding": 0,
"fontScale": 1,
"backgroundOpacity": 0.93,
"useSeparateOpacity": false,
@@ -506,4 +507,4 @@
"gridSnap": false,
"monitorWidgets": []
}
}
}
+1
View File
@@ -179,6 +179,7 @@ Singleton {
property real capsuleOpacity: 1.0
property string capsuleColorKey: "none"
property int widgetSpacing: 6
property int contentPadding: 0
property real fontScale: 1.0
// Bar background opacity settings
+4 -4
View File
@@ -344,7 +344,7 @@ Item {
ColumnLayout {
x: Style.pixelAlignCenter(parent.width, width)
anchors.top: parent.top
anchors.topMargin: verticalBarMargin
anchors.topMargin: verticalBarMargin + Settings.data.bar.contentPadding
spacing: Settings.data.bar.widgetSpacing
Repeater {
@@ -395,7 +395,7 @@ Item {
ColumnLayout {
x: Style.pixelAlignCenter(parent.width, width)
anchors.bottom: parent.bottom
anchors.bottomMargin: verticalBarMargin
anchors.bottomMargin: verticalBarMargin + Settings.data.bar.contentPadding
spacing: Settings.data.bar.widgetSpacing
Repeater {
@@ -452,7 +452,7 @@ Item {
id: leftSection
objectName: "leftSection"
anchors.left: parent.left
anchors.leftMargin: horizontalBarMargin
anchors.leftMargin: horizontalBarMargin + Settings.data.bar.contentPadding
y: Style.pixelAlignCenter(parent.height, height)
spacing: Settings.data.bar.widgetSpacing
@@ -507,7 +507,7 @@ Item {
id: rightSection
objectName: "rightSection"
anchors.right: parent.right
anchors.rightMargin: horizontalBarMargin
anchors.rightMargin: horizontalBarMargin + Settings.data.bar.contentPadding
y: Style.pixelAlignCenter(parent.height, height)
spacing: Settings.data.bar.widgetSpacing
@@ -168,6 +168,20 @@ ColumnLayout {
text: Settings.data.bar.widgetSpacing + "px"
}
NValueSlider {
Layout.fillWidth: true
label: I18n.tr("panels.bar.appearance-content-padding-label")
description: I18n.tr("panels.bar.appearance-content-padding-description")
from: 0
to: 30
stepSize: 1
showReset: true
value: Settings.data.bar.contentPadding
defaultValue: Settings.getDefaultValue("bar.contentPadding")
onMoved: value => Settings.data.bar.contentPadding = value
text: Settings.data.bar.contentPadding + "px"
}
NToggle {
Layout.fillWidth: true
label: I18n.tr("panels.bar.appearance-show-outline-label")