diff --git a/config/BorderConfig.qml b/config/BorderConfig.qml index b15811fd..b203925d 100644 --- a/config/BorderConfig.qml +++ b/config/BorderConfig.qml @@ -3,4 +3,7 @@ import Quickshell.Io JsonObject { property int thickness: Appearance.padding.normal property int rounding: Appearance.rounding.large + + readonly property int minThickness: 2 + readonly property int clampedThickness: Math.max(minThickness, thickness) } diff --git a/modules/bar/BarWrapper.qml b/modules/bar/BarWrapper.qml index 29961b62..5fddf5cd 100644 --- a/modules/bar/BarWrapper.qml +++ b/modules/bar/BarWrapper.qml @@ -14,6 +14,7 @@ Item { required property BarPopouts.Wrapper popouts required property bool disabled + readonly property int clampedWidth: Math.max(Config.border.minThickness, implicitWidth) readonly property int padding: Math.max(Appearance.padding.smaller, Config.border.thickness) readonly property int contentWidth: Config.bar.sizes.innerWidth + padding * 2 readonly property int exclusiveZone: !disabled && (Config.bar.persistent || visibilities.bar) ? contentWidth : Config.border.thickness diff --git a/modules/controlcenter/appearance/sections/BorderSection.qml b/modules/controlcenter/appearance/sections/BorderSection.qml index 9532d70d..a259f934 100644 --- a/modules/controlcenter/appearance/sections/BorderSection.qml +++ b/modules/controlcenter/appearance/sections/BorderSection.qml @@ -50,7 +50,7 @@ CollapsibleSection { label: qsTr("Border thickness") value: rootPane.borderThickness - from: 0.1 + from: 0 to: 100 decimals: 1 suffix: "px" diff --git a/modules/drawers/Drawers.qml b/modules/drawers/Drawers.qml index 86c9e99d..302353be 100644 --- a/modules/drawers/Drawers.qml +++ b/modules/drawers/Drawers.qml @@ -57,10 +57,10 @@ Variants { WlrLayershell.keyboardFocus: visibilities.launcher || visibilities.session ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None mask: Region { - x: bar.implicitWidth + win.dragMaskPadding - y: Config.border.thickness + win.dragMaskPadding - width: win.width - bar.implicitWidth - Config.border.thickness - win.dragMaskPadding * 2 - height: win.height - Config.border.thickness * 2 - win.dragMaskPadding * 2 + x: bar.clampedWidth + win.dragMaskPadding + y: Config.border.clampedThickness + win.dragMaskPadding + width: win.width - bar.clampedWidth - Config.border.clampedThickness - win.dragMaskPadding * 2 + height: win.height - Config.border.clampedThickness * 2 - win.dragMaskPadding * 2 intersection: Intersection.Xor regions: regions.instances diff --git a/modules/drawers/Interactions.qml b/modules/drawers/Interactions.qml index 9579b15a..10807fce 100644 --- a/modules/drawers/Interactions.qml +++ b/modules/drawers/Interactions.qml @@ -33,15 +33,15 @@ CustomMouseArea { } function inRightPanel(panel: Item, x: real, y: real): bool { - return x > bar.implicitWidth + panel.x && withinPanelHeight(panel, x, y); + return x > Math.min(width - Config.border.minThickness, bar.implicitWidth + panel.x) && withinPanelHeight(panel, x, y); } function inTopPanel(panel: Item, x: real, y: real): bool { - return y < Config.border.thickness + panel.y + panel.height && withinPanelWidth(panel, x, y); + return y < Math.max(Config.border.minThickness, Config.border.thickness + panel.height) + panel.y && withinPanelWidth(panel, x, y); } - function inBottomPanel(panel: Item, x: real, y: real): bool { - return y > root.height - Config.border.thickness - panel.height - Config.border.rounding && withinPanelWidth(panel, x, y); + function inBottomPanel(panel: Item, x: real, y: real, isCorner = false): bool { + return y > height - Math.max(Config.border.minThickness, Config.border.thickness + panel.height) - (isCorner ? Config.border.rounding : 0) && withinPanelWidth(panel, x, y); } function onWheel(event: WheelEvent): void { @@ -88,11 +88,11 @@ CustomMouseArea { const dragY = y - dragStart.y; // Show bar in non-exclusive mode on hover - if (!visibilities.bar && Config.bar.showOnHover && x < bar.implicitWidth) + if (!visibilities.bar && Config.bar.showOnHover && x < bar.clampedWidth) bar.isHovered = true; // Show/hide bar on drag - if (pressed && dragStart.x < bar.implicitWidth) { + if (pressed && dragStart.x < bar.clampedWidth) { if (dragX > Config.bar.dragThreshold) visibilities.bar = true; else if (dragX < -Config.bar.dragThreshold) @@ -113,7 +113,7 @@ CustomMouseArea { root.panels.osd.hovered = true; } - const showSidebar = pressed && dragStart.x > bar.implicitWidth + panels.sidebar.x; + const showSidebar = pressed && dragStart.x > Math.min(width - Config.border.minThickness, bar.implicitWidth + panels.sidebar.x); // Show/hide session on drag if (pressed && inRightPanel(panels.session, dragStart.x, dragStart.y) && withinPanelHeight(panels.session, x, y)) { @@ -188,7 +188,7 @@ CustomMouseArea { } // Show utilities on hover - const showUtilities = inBottomPanel(panels.utilities, x, y); + const showUtilities = inBottomPanel(panels.utilities, x, y, true); // Always update visibility based on hover if not in shortcut mode if (!utilitiesShortcutActive) {