From 4e162bd8a6a269b01d53343abe3576e10073e42f Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Mon, 9 Mar 2026 23:27:52 +0100 Subject: [PATCH] hefty: bar: fix weird popup shape when smaller than container --- .../bar/HBarWidgetShapeBackground.qml | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/HBarWidgetShapeBackground.qml b/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/HBarWidgetShapeBackground.qml index 6c32d72ba..c540d9163 100644 --- a/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/HBarWidgetShapeBackground.qml +++ b/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/HBarWidgetShapeBackground.qml @@ -111,12 +111,12 @@ Shapes.ShapeCanvas { } color: bgShape.showPopup || progress < 1 ? C.Appearance.colors.colLayer3Base : C.Appearance.colors.colLayer1 xOffset: { - if (!vertical) return showPopup ? -popupXOffset : 0; + if (!vertical) return showPopup ? Math.max(-popupXOffset, 0) : 0; else return bgShape.atBottom ? (width - containerShape.width) : 0; } yOffset: { if (!vertical) return bgShape.atBottom ? (height - containerShape.height) : 0; - else return showPopup ? -popupYOffset : 0; + else return showPopup ? Math.max(-popupYOffset, 0) : 0; } animation: Anim {} @@ -161,64 +161,64 @@ Shapes.ShapeCanvas { roundedPolygon: { var points = []; if (!bgShape.showPopup) return containerShape.getFullShape(); - if (!bgShape.vertical) { + + const joinRadiusOverride = containerShape.radiusLimit; + if (!bgShape.vertical) { + const popupBigger = bgShape.popupWidth > bgShape.backgroundWidth; // Inline comment spam to mitigate qmlls' sabotaging of the (code) layout points = [ ...(bgShape.atBottom ? containerShape.getFirstBottomPoints() : [ // ...popupShape.getFirstBottomPoints(), popupShape.getBottomLeftPoint(), // ...popupShape.leftPoints, // - popupShape.getTopLeftPoint(), // + popupShape.getTopLeftPoint(0, -bgShape.spacing * (!popupBigger), joinRadiusOverride), // ]), // - containerShape.getBottomLeftPoint(0, bgShape.spacing * (!bgShape.atBottom ? 1 : 0), containerShape.radiusLimit), // - containerShape.getTopLeftPoint(0, bgShape.spacing * (bgShape.atBottom ? -1 : 0), containerShape.radiusLimit), // + containerShape.getBottomLeftPoint(0, bgShape.spacing * (!bgShape.atBottom && popupBigger), joinRadiusOverride), // + containerShape.getTopLeftPoint(0, -bgShape.spacing * (bgShape.atBottom && popupBigger), joinRadiusOverride), // ...(!bgShape.atBottom ? containerShape.topPoints : [ // - popupShape.getBottomLeftPoint(), // + popupShape.getBottomLeftPoint(0, bgShape.spacing * (!popupBigger), joinRadiusOverride), // ...popupShape.leftPoints, // popupShape.getTopLeftPoint(), // ...popupShape.topPoints, // popupShape.getTopRightPoint(), // ...popupShape.rightPoints, // - popupShape.getBottomRightPoint(), // + popupShape.getBottomRightPoint(0, bgShape.spacing * (!popupBigger), joinRadiusOverride), // ]), // - containerShape.getTopRightPoint(0, bgShape.spacing * (bgShape.atBottom ? -1 : 0), containerShape.radiusLimit), // - containerShape.getBottomRightPoint(0, bgShape.spacing * (!bgShape.atBottom ? 1 : 0), containerShape.radiusLimit), // + containerShape.getTopRightPoint(0, -bgShape.spacing * (bgShape.atBottom && popupBigger), joinRadiusOverride), // + containerShape.getBottomRightPoint(0, bgShape.spacing * (!bgShape.atBottom && popupBigger), joinRadiusOverride), // ...(bgShape.atBottom ? containerShape.getLastBottomPoints() : [ // - popupShape.getTopRightPoint(), // + popupShape.getTopRightPoint(0, -bgShape.spacing * (!popupBigger), joinRadiusOverride), // ...popupShape.rightPoints, // popupShape.getBottomRightPoint(), // ...popupShape.getLastBottomPoints(), // ]), ]; } else { + const popupBigger = bgShape.popupHeight > bgShape.backgroundHeight; points = [ // ...containerShape.getFirstBottomPoints(), // - containerShape.getBottomLeftPoint(), // + containerShape.getBottomLeftPoint(-bgShape.spacing * (popupBigger && bgShape.atBottom), 0, joinRadiusOverride), // ...(!bgShape.atBottom ? containerShape.leftPoints : [ // - containerShape.getBottomLeftPoint(-bgShape.spacing, 0, containerShape.radiusLimit), // - popupShape.getBottomRightPoint(), // + popupShape.getBottomRightPoint(bgShape.spacing * (!popupBigger)), // ...popupShape.bottomPoints, // popupShape.getBottomLeftPoint(), // ...popupShape.leftPoints, // popupShape.getTopLeftPoint(), // ...popupShape.topPoints, // - popupShape.getTopRightPoint(), // - containerShape.getTopLeftPoint(-bgShape.spacing, 0, containerShape.radiusLimit), // + popupShape.getTopRightPoint(bgShape.spacing * (!popupBigger)), // ]), // - containerShape.getTopLeftPoint(), // + containerShape.getTopLeftPoint(-bgShape.spacing * (popupBigger && bgShape.atBottom), 0, joinRadiusOverride), // ...containerShape.topPoints, // - containerShape.getTopRightPoint(), // + containerShape.getTopRightPoint(bgShape.spacing * (popupBigger && !bgShape.atBottom), 0, joinRadiusOverride), // ...(bgShape.atBottom ? containerShape.rightPoints : [ // - containerShape.getTopRightPoint(bgShape.spacing, 0, containerShape.radiusLimit), // - popupShape.getTopLeftPoint(), // + popupShape.getTopLeftPoint(-bgShape.spacing * (!popupBigger), 0, joinRadiusOverride), // ...popupShape.topPoints, // popupShape.getTopRightPoint(), // ...popupShape.rightPoints, // popupShape.getBottomRightPoint(), // ...popupShape.bottomPoints, // - popupShape.getBottomLeftPoint(), // - containerShape.getBottomRightPoint(bgShape.spacing, 0, containerShape.radiusLimit), // + popupShape.getBottomLeftPoint(-bgShape.spacing * (!popupBigger), 0, joinRadiusOverride), // ]), // - containerShape.getBottomRightPoint(), // + containerShape.getBottomRightPoint(bgShape.spacing * (popupBigger && !bgShape.atBottom), 0, joinRadiusOverride), // ...containerShape.getLastBottomPoints(), // ]; }