repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

fix(nuguland): vertical bar — single-column stacking and anchor swap

bf3c273c3a0ee01e0b7a56f363ae03c58f4fa5f8

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Three layout bugs surfaced live in vertical mode: GridLayout needs an
explicit column count (not flow) to force one column; nested grid items
(workspace trays, pills) must expose Layout.preferredWidth/Height or the
grid ignores their size; and swapping anchors via 'undefined' does not
clear them, so the widgets/workspace zones used AnchorChanges states.
Vertical bar now stacks all widgets, pills, and the clock correctly.

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

Changed files (1)

+66 / −23 text lines

Diff layout

quickshell/nuguland/Bar.qml

Modified

+66 / −23 text lines

269269 GridLayout {
270270 id: workspaceStrip
272 flow: root.vertical ? GridLayout.TopToBottom : GridLayout.LeftToRight
273 anchors.left: parent.left
274 anchors.top: root.vertical ? parent.top : undefined
275 anchors.leftMargin: root.vertical ? 0 : 10
276 anchors.topMargin: root.vertical ? 10 : 0
277 anchors.right: root.vertical ? parent.right : clockChip.left
278 anchors.rightMargin: root.vertical ? 0 : 12
279 anchors.bottom: root.vertical ? clockStack.top : undefined
280 anchors.bottomMargin: root.vertical ? 10 : 0
281 anchors.verticalCenter: root.vertical ? undefined : parent.verticalCenter
282 anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined
272 // horizontal base: single row from the left edge up to the clock,
273 // centred vertically. Vertical state swaps to a single column from
274 // the top down to the clock, centred horizontally.
275 columns: root.vertical ? 1 : 99
283276 rowSpacing: 8
284277 columnSpacing: 8
285278 clip: true
279 anchors.left: parent.left
280 anchors.leftMargin: 10
281 anchors.right: clockChip.left
282 anchors.rightMargin: 12
283 anchors.verticalCenter: parent.verticalCenter
285 states: State {
286 when: root.vertical
288 AnchorChanges {
289 target: workspaceStrip
290 anchors.left: undefined
291 anchors.right: undefined
292 anchors.verticalCenter: undefined
293 anchors.top: parent.top
294 anchors.bottom: clockStack.top
295 anchors.horizontalCenter: parent.horizontalCenter
296 }
298 PropertyChanges {
299 target: workspaceStrip
300 anchors.leftMargin: 0
301 anchors.rightMargin: 0
302 anchors.topMargin: 10
303 anchors.bottomMargin: 10
304 }
305 }
287307 Repeater {
288308 model: root.niriService ? root.niriService.workspaceGroups() : []
297317 required property var modelData
299 width: tray.width
300 height: tray.height
319 implicitWidth: tray.width
320 implicitHeight: tray.height
321 Layout.preferredWidth: tray.width
322 Layout.preferredHeight: tray.height
301323 Layout.alignment: Qt.AlignCenter
303325 Rectangle {
315337 id: pills
317339 anchors.centerIn: parent
318 flow: root.vertical ? GridLayout.TopToBottom : GridLayout.LeftToRight
340 columns: root.vertical ? 1 : 99
319341 rowSpacing: 4
320342 columnSpacing: 4
328350 required property var modelData
330 width: workspaceChip.width
331 height: workspaceChip.height
352 implicitWidth: workspaceChip.width
353 implicitHeight: workspaceChip.height
354 Layout.preferredWidth: workspaceChip.width
355 Layout.preferredHeight: workspaceChip.height
332356 Layout.alignment: Qt.AlignCenter
334358 Rectangle {
390414 GridLayout {
391415 id: widgetsRow
393 flow: root.vertical ? GridLayout.TopToBottom : GridLayout.LeftToRight
394 anchors.right: root.vertical ? undefined : parent.right
395 anchors.rightMargin: root.vertical ? 0 : 10
396 anchors.bottom: root.vertical ? parent.bottom : undefined
397 anchors.bottomMargin: root.vertical ? 10 : 0
398 anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined
399 anchors.verticalCenter: root.vertical ? undefined : parent.verticalCenter
417 // horizontal base: single row pinned to the right edge, centred
418 // vertically. The vertical state swaps to a single column pinned to
419 // the bottom edge, centred horizontally. AnchorChanges is required
420 // because clearing an anchor with `undefined` does not reset it.
421 columns: root.vertical ? 1 : 99
400422 rowSpacing: 4
401423 columnSpacing: 4
424 anchors.right: parent.right
425 anchors.rightMargin: 10
426 anchors.verticalCenter: parent.verticalCenter
428 states: State {
429 when: root.vertical
431 AnchorChanges {
432 target: widgetsRow
433 anchors.right: undefined
434 anchors.verticalCenter: undefined
435 anchors.bottom: parent.bottom
436 anchors.horizontalCenter: parent.horizontalCenter
437 }
439 PropertyChanges {
440 target: widgetsRow
441 anchors.rightMargin: 0
442 anchors.bottomMargin: 10
443 }
444 }
403446 Repeater {
404447 model: root.usageService ? root.usageService.layoutOrder : []