repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

feat(nuguland): vertical popout geometry — open beside the left bar

8e336af0a681b761c90294ea04d7ec0b9041c2b1

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Phase 2 of vertical/horizontal orientation. SurfaceManager emits
left-edge popout geometry in vertical mode (anchor at bar thickness,
full screen height, card slides rightward, clamp on the y-axis);
setPopoutScreen now carries orientation. PopoutHost moves its input and
dismiss region beside the bar and subtracts the bar on the correct axis.
OSD/toast untouched (top-right, bar-independent).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Changed files (2)

quickshell/nuguland/PopoutHost.qml

Modified
45 45 readonly property var currentRect: cardFrame.currentRect
46 46 readonly property string activeName: surfaces ? surfaces.popoutName : ""
47 47 readonly property string removingName: surfaces ? surfaces.removingLoaderName : ""
48 - readonly property int surfaceWidth: surfaces && surfaces.screenWidth > 0 ? surfaces.screenWidth : contentSize.width
49 - readonly property int surfaceHeight: surfaces && surfaces.screenHeight > 0 ? Math.max(1, surfaces.screenHeight - surfaces.barHeight) : contentSize.height
48 + readonly property bool vertical: surfaces && surfaces.orientation === "vertical"
49 + // subtract the bar on whichever axis it occupies (top for horizontal, left
50 + // for vertical) so the popout surface covers only the free region.
51 + readonly property int surfaceWidth: surfaces && surfaces.screenWidth > 0 ? (root.vertical ? Math.max(1, surfaces.screenWidth - surfaces.barHeight) : surfaces.screenWidth) : contentSize.width
52 + readonly property int surfaceHeight: surfaces && surfaces.screenHeight > 0 ? (root.vertical ? surfaces.screenHeight : Math.max(1, surfaces.screenHeight - surfaces.barHeight)) : contentSize.height
51 54 function contentComponent(name) {
52 55 switch (String(name)) {
117 120 Item {
118 121 id: popoutInputRegion
120 - x: 0
121 - y: root.surfaces ? root.surfaces.barHeight : 0
122 - width: parent.width
123 + // origin sits just past the bar: below it (horizontal) or right of it
124 + // (vertical), so clicks on the bar itself are never captured here.
125 + x: root.vertical && root.surfaces ? root.surfaces.barHeight : 0
126 + y: root.vertical || !root.surfaces ? 0 : root.surfaces.barHeight
127 + width: Math.max(1, parent.width - x)
123 128 height: Math.max(1, parent.height - y)

quickshell/nuguland/SurfaceManager.qml

Modified
19 19 property int screenWidth: 0
20 20 property int screenHeight: 0
21 21 property int barHeight: 34
22 + property string orientation: "horizontal"
23 + readonly property bool vertical: orientation === "vertical"
22 24 property var anchorRegistry: ({
24 26 readonly property int closeRetentionMs: 0
48 50 function popoutWidth() {
49 - if (screenWidth <= 0)
51 + const along = vertical ? Math.max(0, screenWidth - barHeight) : screenWidth;
52 + if (along <= 0)
50 53 return 844;
52 - return Math.max(520, Math.min(920, Math.round(screenWidth / goldenRatio)));
55 + return Math.max(520, Math.min(920, Math.round(along / goldenRatio)));
55 58 function heightBudget(wanted) {
56 - const maxHeight = screenHeight > 0 ? Math.max(260, screenHeight - barHeight - 48) : 680;
59 + const reserve = vertical ? 48 : barHeight + 48;
60 + const maxHeight = screenHeight > 0 ? Math.max(260, screenHeight - reserve) : 680;
57 61 return Math.min(maxHeight, Math.max(220, Number(wanted)));
126 130 function popupWindowAnchorRect() {
131 + if (vertical)
132 + return {
133 + "x": Math.max(1, Math.round(barHeight)),
134 + "y": 0,
135 + "width": 1,
136 + "height": screenHeight > 0 ? screenHeight : popoutContentSize(popoutName).height
137 + };
127 139 return {
128 140 "x": 0,
129 141 "y": Math.max(1, Math.round(barHeight)),
135 147 function popupCardFrame(progress) {
136 148 const t = Math.max(0, Math.min(1, Number(progress)));
137 149 const contentSize = popoutContentSize(popoutName);
150 + if (vertical) {
151 + const surfaceHeight = screenHeight > 0 ? screenHeight : contentSize.height;
152 + return {
153 + "source": "left-bar-slide-fade",
154 + "progress": t,
155 + "currentRect": {
156 + "x": Math.round(barHeight - 18 + 26 * t),
157 + "y": Math.max(8, Math.round((surfaceHeight - contentSize.height) / 2) + 8),
158 + "width": Math.max(1, Math.round(contentSize.width - 16)),
159 + "height": Math.max(1, Math.round(contentSize.height - 16))
160 + },
161 + "opacity": t
162 + };
138 164 const surfaceWidth = screenWidth > 0 ? screenWidth : contentSize.width;
139 165 return {
140 166 "source": "simple-center-slide-fade",
226 252 return JSON.stringify(anchorRegistry);
229 - function setPopoutScreen(width, height, topBarHeight) {
255 + function setPopoutScreen(width, height, topBarThickness, orient) {
230 256 screenWidth = Math.max(0, Number(width));
231 257 screenHeight = Math.max(0, Number(height));
232 - barHeight = Math.max(1, Number(topBarHeight || barHeight));
258 + barHeight = Math.max(1, Number(topBarThickness || barHeight));
259 + if (orient === "horizontal" || orient === "vertical")
260 + orientation = orient;
233 262 return popoutState();
236 265 function clampedTarget(origin, contentSize) {
237 - let x = Math.round(origin.x - contentSize.width / 2);
238 266 const edges = [];
267 + if (vertical) {
268 + let y = Math.round(origin.y - contentSize.height / 2);
269 + if (y < 0) {
270 + y = 0;
271 + edges.push("top");
273 + if (screenHeight > 0 && y + contentSize.height > screenHeight) {
274 + y = Math.max(0, screenHeight - contentSize.height);
275 + edges.length = 0;
276 + edges.push("bottom");
278 + return {
279 + "rect": {
280 + "x": Math.max(0, Math.round(barHeight)),
281 + "y": y,
282 + "width": contentSize.width,
283 + "height": contentSize.height
284 + },
285 + "edges": edges
286 + };
288 + let x = Math.round(origin.x - contentSize.width / 2);
239 289 if (x < 0) {
240 290 x = 0;
241 291 edges.push("left");
337 387 function popoutState() {
338 388 const contentSize = popoutContentSize(popoutName);
339 - const origin = {
389 + const origin = vertical ? {
390 + "x": Math.round(popoutAnchor.x + popoutAnchor.width),
391 + "y": Math.round(popoutAnchor.y + popoutAnchor.height / 2)
392 + } : {
340 393 "x": Math.round(popoutAnchor.x + popoutAnchor.width / 2),
341 394 "y": Math.round(popoutAnchor.y + popoutAnchor.height)
365 418 "progress": popoutProgress,
366 419 "transition": {
367 420 "host": "bar",
368 - "animation": "simple-center-slide-fade",
369 - "direction": popoutClosing ? "up-out" : "down-in",
421 + "animation": vertical ? "left-bar-slide-fade" : "simple-center-slide-fade",
422 + "direction": vertical ? (popoutClosing ? "left-out" : "right-in") : (popoutClosing ? "up-out" : "down-in"),
370 423 "loaderActive": popoutOpen,
371 424 "targetRect": popupWindowAnchorRect()