repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

caldav: stretch calendar grid to full popout width

ad75db34cdb272f3f7192094ae5d3c130247a296

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Grid cells were fixed 30px in an 844px popout — cramped top-left with the
right two-thirds empty. Make cell width responsive (fill the full width /7),
taller cells (36), wider gaps (4), and derive the band overlay pitch from
the live cell size instead of the old hardcoded 32. Nudge the day number +
today circle up to leave room for the marker strip. Grow the clock popout
to 490 so the full agenda fits.

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

Changed files (2)

quickshell/nuguland/PopoutHost.qml

Modified
268 268 readonly property bool setupMode: root.caldavService && root.caldavService.status === "needs-setup"
270 + // grid sizing: cells stretch to fill the full popout width
271 + readonly property int gridSpacing: 4
272 + readonly property real cellW: (width - gridSpacing * 6) / 7
273 + readonly property int cellH: 36
274 + readonly property real pitchX: cellW + gridSpacing
275 + readonly property real pitchY: cellH + gridSpacing
270 277 // iso "YYYY-MM-DD" -> array of single-day markers {color, allDay}.
271 278 // Multi-day events (coveredDates>1) are drawn as bands, not markers.
272 279 readonly property var caldavEvents: root.caldavService ? root.caldavService.events : []
339 346 // single-letter weekday header, Monday-first; weekend dimmed
341 348 visible: !clockCol.setupMode
342 - spacing: 2
349 + spacing: clockCol.gridSpacing
344 351 Repeater {
345 352 model: ["M", "D", "M", "D", "F", "S", "S"]
347 354 Item {
348 - width: 30
355 + width: clockCol.cellW
349 356 height: hdr.height
351 358 NuguText {
375 382 objectName: "calendar-grid"
376 383 columns: 7
377 - spacing: 2
384 + spacing: clockCol.gridSpacing
379 386 Repeater {
380 387 model: clockCol.days
385 392 readonly property var markers: clockCol.eventsByDate[modelData.iso] || []
387 - width: 30
388 - height: 30
394 + width: clockCol.cellW
395 + height: clockCol.cellH
390 397 // today: filled accent circle behind the number
391 398 Rectangle {
392 399 visible: !!modelData.today
393 - anchors.centerIn: parent
394 - width: 22
395 - height: 22
396 - radius: 11
400 + anchors.horizontalCenter: parent.horizontalCenter
401 + y: (parent.height - height) / 2 - 4
402 + width: 26
403 + height: 26
404 + radius: 13
397 405 color: root.theme ? root.theme.ui.accent : "transparent"
400 408 NuguText {
401 - anchors.centerIn: parent
409 + anchors.horizontalCenter: parent.horizontalCenter
410 + y: (parent.height - height) / 2 - 4
402 411 theme: root.theme
403 412 variant: "meta"
404 413 text: modelData.day ? String(modelData.day) : ""
439 448 // multi-day band overlay: thin lane-stacked bars over the grid.
440 - // pitch matches cell (30) + spacing (2) = 32; bands sit near
441 - // the cell bottom, stacking upward per lane.
449 + // pitch derives from the live cell size; bands sit near the
450 + // cell bottom, stacking upward per lane.
442 451 Item {
443 452 anchors.fill: monthGrid
449 458 Rectangle {
450 459 readonly property var seg: modelData
452 - x: seg.colStart * 32
453 - y: seg.row * 32 + 23 - seg.lane * 7
454 - width: (seg.colEnd - seg.colStart + 1) * 32 - 2
461 + x: seg.colStart * clockCol.pitchX
462 + y: seg.row * clockCol.pitchY + clockCol.cellH - 9 - seg.lane * 7
463 + width: (seg.colEnd - seg.colStart + 1) * clockCol.pitchX - clockCol.gridSpacing
455 464 height: 5
456 465 color: Qt.alpha(seg.color, 0.9)
457 466 topLeftRadius: seg.roundLeft ? 2.5 : 0

quickshell/nuguland/SurfaceManager.qml

Modified
67 67 case "clock":
68 68 return {
69 69 "width": width,
70 - "height": heightBudget(440)
70 + "height": heightBudget(490)
72 72 case "system":
73 73 return {