diff --git a/Common/SettingsData.qml b/Common/SettingsData.qml index bba83773..a5b30c0e 100644 --- a/Common/SettingsData.qml +++ b/Common/SettingsData.qml @@ -240,6 +240,7 @@ Singleton { property int dockPosition: SettingsData.Position.Bottom property real dockSpacing: 4 property real dockBottomGap: 0 + property real dockMargin: 0 property real dockIconSize: 40 property string dockIndicatorStyle: "circle" diff --git a/Common/settings/SettingsSpec.js b/Common/settings/SettingsSpec.js index 32c8d0dc..d08d722b 100644 --- a/Common/settings/SettingsSpec.js +++ b/Common/settings/SettingsSpec.js @@ -157,6 +157,7 @@ var SPEC = { dockPosition: { def: 1 }, dockSpacing: { def: 4 }, dockBottomGap: { def: 0 }, + dockMargin: { def: 0 }, dockIconSize: { def: 40 }, dockIndicatorStyle: { def: "circle" }, diff --git a/Modules/Dock/Dock.qml b/Modules/Dock/Dock.qml index 8c75548f..3c9b5bf4 100644 --- a/Modules/Dock/Dock.qml +++ b/Modules/Dock/Dock.qml @@ -54,7 +54,7 @@ Variants { } readonly property real dockMargin: SettingsData.dockSpacing - readonly property real positionSpacing: barSpacing + SettingsData.dockBottomGap + readonly property real positionSpacing: barSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin readonly property real _dpr: (dock.screen && dock.screen.devicePixelRatio) ? dock.screen.devicePixelRatio : 1 function px(v) { return Math.round(v * _dpr) / _dpr } @@ -103,13 +103,13 @@ Variants { exclusiveZone: { if (!SettingsData.showDock || autoHide) return -1 if (barSpacing > 0) return -1 - return px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap) + return px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin) } property real animationHeadroom: Math.ceil(SettingsData.dockIconSize * 0.35) - implicitWidth: isVertical ? (px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockIconSize * 0.3) + animationHeadroom) : 0 - implicitHeight: !isVertical ? (px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockIconSize * 0.3) + animationHeadroom) : 0 + implicitWidth: isVertical ? (px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin + SettingsData.dockIconSize * 0.3) + animationHeadroom) : 0 + implicitHeight: !isVertical ? (px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin + SettingsData.dockIconSize * 0.3) + animationHeadroom) : 0 Item { id: maskItem @@ -188,7 +188,7 @@ Variants { const isBottom = SettingsData.dockPosition === SettingsData.Position.Bottom const globalX = buttonGlobalPos.x + dock.hoveredButton.width / 2 const screenRelativeY = isBottom - ? (screenHeight - dock.effectiveBarHeight - SettingsData.dockSpacing - SettingsData.dockBottomGap - 35) + ? (screenHeight - dock.effectiveBarHeight - SettingsData.dockSpacing - SettingsData.dockBottomGap - SettingsData.dockMargin - 35) : (buttonGlobalPos.y - screenY + dock.hoveredButton.height + Theme.spacingS) dockTooltip.show(tooltipText, globalX, @@ -197,7 +197,7 @@ Variants { false, false) } else { const isLeft = SettingsData.dockPosition === SettingsData.Position.Left - const tooltipOffset = dock.effectiveBarHeight + SettingsData.dockSpacing + Theme.spacingXS + const tooltipOffset = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockMargin + Theme.spacingXS const tooltipX = isLeft ? tooltipOffset : (dock.screen.width - tooltipOffset) const screenRelativeY = buttonGlobalPos.y - screenY + dock.hoveredButton.height / 2 dockTooltip.show(tooltipText, @@ -259,12 +259,12 @@ Variants { if (dock.isVertical) { return dock.reveal ? Math.min(dockBackground.implicitHeight + 4, maxDockHeight) : Math.min(Math.max(dockBackground.implicitHeight + 64, 200), screenHeight * 0.5) } else { - return dock.reveal ? px(dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap) : 1 + return dock.reveal ? px(dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin) : 1 } } width: { if (dock.isVertical) { - return dock.reveal ? px(dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap) : 1 + return dock.reveal ? px(dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin) : 1 } else { return dock.reveal ? Math.min(dockBackground.implicitWidth + 4, maxDockWidth) : Math.min(Math.max(dockBackground.implicitWidth + 64, 200), screenWidth * 0.5) } @@ -304,7 +304,7 @@ Variants { x: { if (!dock.isVertical) return 0 if (dock.reveal) return 0 - const hideDistance = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + 10 + const hideDistance = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin + 10 if (SettingsData.dockPosition === SettingsData.Position.Right) { return hideDistance } else { @@ -314,7 +314,7 @@ Variants { y: { if (dock.isVertical) return 0 if (dock.reveal) return 0 - const hideDistance = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + 10 + const hideDistance = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin + 10 if (SettingsData.dockPosition === SettingsData.Position.Bottom) { return hideDistance } else { @@ -350,10 +350,10 @@ Variants { right: dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Right ? parent.right : undefined) : undefined verticalCenter: dock.isVertical ? parent.verticalCenter : undefined } - anchors.topMargin: !dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Top ? barSpacing + 1 : 0 - anchors.bottomMargin: !dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom ? barSpacing + 1 : 0 - anchors.leftMargin: dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Left ? barSpacing + 1 : 0 - anchors.rightMargin: dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Right ? barSpacing + 1 : 0 + anchors.topMargin: !dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Top ? barSpacing + SettingsData.dockMargin + 1 : 0 + anchors.bottomMargin: !dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom ? barSpacing + SettingsData.dockMargin + 1 : 0 + anchors.leftMargin: dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Left ? barSpacing + SettingsData.dockMargin + 1 : 0 + anchors.rightMargin: dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Right ? barSpacing + SettingsData.dockMargin + 1 : 0 implicitWidth: dock.isVertical ? (dockApps.implicitHeight + SettingsData.dockSpacing * 2) : (dockApps.implicitWidth + SettingsData.dockSpacing * 2) implicitHeight: dock.isVertical ? (dockApps.implicitWidth + SettingsData.dockSpacing * 2) : (dockApps.implicitHeight + SettingsData.dockSpacing * 2) diff --git a/Modules/Dock/DockContextMenu.qml b/Modules/Dock/DockContextMenu.qml index 8d569dc8..4f87af27 100644 --- a/Modules/Dock/DockContextMenu.qml +++ b/Modules/Dock/DockContextMenu.qml @@ -91,7 +91,7 @@ PanelWindow { } const isVertical = SettingsData.dockPosition === SettingsData.Position.Left || SettingsData.dockPosition === SettingsData.Position.Right - const dockMargin = 16 + const dockMargin = SettingsData.dockMargin + 16 let buttonScreenX, buttonScreenY if (isVertical) { diff --git a/Modules/Settings/AboutTab.qml b/Modules/Settings/AboutTab.qml index b4362b33..25c61c6c 100644 --- a/Modules/Settings/AboutTab.qml +++ b/Modules/Settings/AboutTab.qml @@ -42,7 +42,7 @@ Item { return "niri GitHub" } - property string dmsDiscordUrl: "https://discord.gg/vT8Sfjy7sx" + property string dmsDiscordUrl: "https://discord.gg/ppWTpKmPgT" property string dmsDiscordTooltip: "niri/dms Discord" property string compositorDiscordUrl: { diff --git a/Modules/Settings/DockTab.qml b/Modules/Settings/DockTab.qml index 8ec2886c..9e3b227a 100644 --- a/Modules/Settings/DockTab.qml +++ b/Modules/Settings/DockTab.qml @@ -547,11 +547,38 @@ Item { wheelEnabled: false thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) onSliderValueChanged: newValue => { - SettingsData.set("dockBottomGap", + SettingsData.set("dockBottomGap", newValue) } } } + + Column { + width: parent.width + spacing: Theme.spacingS + + StyledText { + text: I18n.tr("Margin") + font.pixelSize: Theme.fontSizeSmall + color: Theme.surfaceText + font.weight: Font.Medium + } + + DankSlider { + width: parent.width + height: 24 + value: SettingsData.dockMargin + minimum: 0 + maximum: 100 + unit: "" + showValue: true + wheelEnabled: false + thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) + onSliderValueChanged: newValue => { + SettingsData.set("dockMargin", newValue) + } + } + } } Behavior on opacity { diff --git a/translations/en.json b/translations/en.json index e9b6c74d..8ddb3c54 100644 --- a/translations/en.json +++ b/translations/en.json @@ -1244,7 +1244,7 @@ { "term": "Dock Transparency", "context": "Dock Transparency", - "reference": "Modules/Settings/DockTab.qml:596", + "reference": "Modules/Settings/DockTab.qml:623", "comment": "" }, { @@ -2081,6 +2081,12 @@ "reference": "Modules/Settings/DankBarTab.qml:875", "comment": "" }, + { + "term": "Margin", + "context": "Margin", + "reference": "Modules/Settings/DockTab.qml:561", + "comment": "" + }, { "term": "Marker Supply Empty", "context": "Marker Supply Empty", diff --git a/translations/poexports/it.json b/translations/poexports/it.json index c9ecca00..02ead657 100644 --- a/translations/poexports/it.json +++ b/translations/poexports/it.json @@ -1064,6 +1064,9 @@ "Manual Show/Hide": { "Manual Show/Hide": "Mostra/Nascondi Manuale" }, + "Margin": { + "Margin": "" + }, "Marker Supply Empty": { "Marker Supply Empty": "" }, diff --git a/translations/poexports/ja.json b/translations/poexports/ja.json index ef6ecc2d..43ab8c0f 100644 --- a/translations/poexports/ja.json +++ b/translations/poexports/ja.json @@ -1064,6 +1064,9 @@ "Manual Show/Hide": { "Manual Show/Hide": "手動で表示/非表示" }, + "Margin": { + "Margin": "" + }, "Marker Supply Empty": { "Marker Supply Empty": "マーカー供給量がない" }, diff --git a/translations/poexports/pt.json b/translations/poexports/pt.json index 7a15f88d..a7cf2948 100644 --- a/translations/poexports/pt.json +++ b/translations/poexports/pt.json @@ -1064,6 +1064,9 @@ "Manual Show/Hide": { "Manual Show/Hide": "Mostrar/Esconder Manualmente" }, + "Margin": { + "Margin": "" + }, "Marker Supply Empty": { "Marker Supply Empty": "" }, diff --git a/translations/poexports/tr.json b/translations/poexports/tr.json index dfeb99a7..6b9f1e32 100644 --- a/translations/poexports/tr.json +++ b/translations/poexports/tr.json @@ -1064,6 +1064,9 @@ "Manual Show/Hide": { "Manual Show/Hide": "Manuel Göster/Gizle" }, + "Margin": { + "Margin": "" + }, "Marker Supply Empty": { "Marker Supply Empty": "Sarf Malzemesi Boş" }, diff --git a/translations/poexports/zh_CN.json b/translations/poexports/zh_CN.json index e9e85b8e..0e36a10b 100644 --- a/translations/poexports/zh_CN.json +++ b/translations/poexports/zh_CN.json @@ -1064,6 +1064,9 @@ "Manual Show/Hide": { "Manual Show/Hide": "手动显示/隐藏" }, + "Margin": { + "Margin": "" + }, "Marker Supply Empty": { "Marker Supply Empty": "打印耗材已用尽" }, diff --git a/translations/poexports/zh_TW.json b/translations/poexports/zh_TW.json index 7f6434dc..ca637ba9 100644 --- a/translations/poexports/zh_TW.json +++ b/translations/poexports/zh_TW.json @@ -1064,6 +1064,9 @@ "Manual Show/Hide": { "Manual Show/Hide": "手動顯示/隱藏" }, + "Margin": { + "Margin": "" + }, "Marker Supply Empty": { "Marker Supply Empty": "" }, diff --git a/translations/template.json b/translations/template.json index c50c62d4..99f5e562 100644 --- a/translations/template.json +++ b/translations/template.json @@ -2428,6 +2428,13 @@ "reference": "", "comment": "" }, + { + "term": "Margin", + "translation": "", + "context": "", + "reference": "", + "comment": "" + }, { "term": "Marker Supply Empty", "translation": "",