mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Merge pull request #2066 from SpeakingPNG/feat/configurable-exclusion-zone
Feat(bar): add a toggle for exclusion zone
This commit is contained in:
@@ -827,6 +827,8 @@
|
|||||||
"appearance-density-label": "Bar density",
|
"appearance-density-label": "Bar density",
|
||||||
"appearance-desc": "Customize the bar's appearance and position.",
|
"appearance-desc": "Customize the bar's appearance and position.",
|
||||||
"appearance-display-mode-description": "Choose when the bar is visible.",
|
"appearance-display-mode-description": "Choose when the bar is visible.",
|
||||||
|
"appearance-enable-exclusion-zone-inset-description": "Reduce the exclusion zone by 1 physical pixel so flush windows bleed perfectly under the bar edge.",
|
||||||
|
"appearance-enable-exclusion-zone-inset-label": "Inset exclusion zone",
|
||||||
"appearance-floating-description": "Display the bar as a floating 'pill'.",
|
"appearance-floating-description": "Display the bar as a floating 'pill'.",
|
||||||
"appearance-floating-label": "Floating bar",
|
"appearance-floating-label": "Floating bar",
|
||||||
"appearance-font-scale-description": "Adjust the font size scale for text displayed in the bar.",
|
"appearance-font-scale-description": "Adjust the font size scale for text displayed in the bar.",
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
"backgroundOpacity": 0.93,
|
"backgroundOpacity": 0.93,
|
||||||
"useSeparateOpacity": false,
|
"useSeparateOpacity": false,
|
||||||
"floating": false,
|
"floating": false,
|
||||||
|
"enableExclusionZoneInset": true,
|
||||||
"marginVertical": 4,
|
"marginVertical": 4,
|
||||||
"marginHorizontal": 4,
|
"marginHorizontal": 4,
|
||||||
"frameThickness": 8,
|
"frameThickness": 8,
|
||||||
|
|||||||
@@ -260,6 +260,15 @@
|
|||||||
"subTab": 0,
|
"subTab": 0,
|
||||||
"subTabLabel": "common.appearance"
|
"subTabLabel": "common.appearance"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"labelKey": "panels.bar.appearance-enable-exclusion-zone-inset-label",
|
||||||
|
"descriptionKey": "panels.bar.appearance-enable-exclusion-zone-inset-description",
|
||||||
|
"widget": "NToggle",
|
||||||
|
"tab": 4,
|
||||||
|
"tabLabel": "panels.bar.title",
|
||||||
|
"subTab": 0,
|
||||||
|
"subTabLabel": "common.appearance"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"labelKey": "panels.bar.appearance-hide-on-overview-label",
|
"labelKey": "panels.bar.appearance-hide-on-overview-label",
|
||||||
"descriptionKey": "panels.bar.appearance-hide-on-overview-description",
|
"descriptionKey": "panels.bar.appearance-hide-on-overview-description",
|
||||||
|
|||||||
@@ -184,6 +184,7 @@ Singleton {
|
|||||||
property int widgetSpacing: 6
|
property int widgetSpacing: 6
|
||||||
property int contentPadding: 2
|
property int contentPadding: 2
|
||||||
property real fontScale: 1.0
|
property real fontScale: 1.0
|
||||||
|
property bool enableExclusionZoneInset: true
|
||||||
|
|
||||||
// Bar background opacity settings
|
// Bar background opacity settings
|
||||||
property real backgroundOpacity: 0.93
|
property real backgroundOpacity: 0.93
|
||||||
|
|||||||
@@ -23,11 +23,12 @@ PanelWindow {
|
|||||||
readonly property bool barFloating: Settings.data.bar.floating || false
|
readonly property bool barFloating: Settings.data.bar.floating || false
|
||||||
readonly property real barMarginH: (barFloating && edge === Settings.getBarPositionForScreen(screen?.name)) ? Math.ceil(Settings.data.bar.marginHorizontal) : 0
|
readonly property real barMarginH: (barFloating && edge === Settings.getBarPositionForScreen(screen?.name)) ? Math.ceil(Settings.data.bar.marginHorizontal) : 0
|
||||||
readonly property real barMarginV: (barFloating && edge === Settings.getBarPositionForScreen(screen?.name)) ? Math.ceil(Settings.data.bar.marginVertical) : 0
|
readonly property real barMarginV: (barFloating && edge === Settings.getBarPositionForScreen(screen?.name)) ? Math.ceil(Settings.data.bar.marginVertical) : 0
|
||||||
// Reduce exclusion zone by 1 physical pixel so app windows blend flush against the bar edge
|
// Allow users to enable a 1-physical-pixel inset for the exclusion zone so window borders can bleed under the bar
|
||||||
|
readonly property real bleedOffset: Settings.data.bar.enableExclusionZoneInset ? 1.0 : 0.0
|
||||||
readonly property real bleedInset: {
|
readonly property real bleedInset: {
|
||||||
const info = CompositorService.displayScales[screen?.name];
|
const info = CompositorService.displayScales[screen?.name];
|
||||||
const scale = (info && info.scale) ? info.scale : 1.0;
|
const scale = (info && info.scale) ? info.scale : 1.0;
|
||||||
return 1.0 / scale;
|
return bleedOffset / scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Invisible - just reserves space
|
// Invisible - just reserves space
|
||||||
|
|||||||
@@ -226,6 +226,15 @@ ColumnLayout {
|
|||||||
text: Math.floor(Settings.data.bar.capsuleOpacity * 100) + "%"
|
text: Math.floor(Settings.data.bar.capsuleOpacity * 100) + "%"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NToggle {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
label: I18n.tr("panels.bar.appearance-enable-exclusion-zone-inset-label")
|
||||||
|
description: I18n.tr("panels.bar.appearance-enable-exclusion-zone-inset-description")
|
||||||
|
checked: Settings.data.bar.enableExclusionZoneInset
|
||||||
|
defaultValue: Settings.getDefaultValue("bar.enableExclusionZoneInset")
|
||||||
|
onToggled: checked => Settings.data.bar.enableExclusionZoneInset = checked
|
||||||
|
}
|
||||||
|
|
||||||
NToggle {
|
NToggle {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
visible: CompositorService.isNiri
|
visible: CompositorService.isNiri
|
||||||
|
|||||||
Reference in New Issue
Block a user