Personal noctalia plugins collection

Raise minimum timed event height for readability

+13 -9
+13 -9
weekly-calendar/Panel.qml
··· 1401 1401 property real duration: Math.max(0, (model.endTime - model.startTime) / 3600000) 1402 1402 1403 1403 property real exactHeight: Math.max(1, duration * (root.hourHeight) - 1) 1404 - property bool isCompact: exactHeight < 40 1404 + property real minEventHeight: 18 * Style.uiScaleRatio 1405 + property real renderHeight: isDeadline 1406 + ? Math.max(8, Math.min(12, exactHeight)) 1407 + : Math.max(exactHeight, minEventHeight) 1408 + property bool isCompact: renderHeight < 40 1405 1409 property var overlapInfo: mainInstance?.overlappingEventsData?.[index] ?? { 1406 1410 xOffset: 0, width: (mainInstance?.dayColumnWidth) - 8, lane: 0, totalLanes: 1 1407 1411 } ··· 1415 1419 1416 1420 visible: dayIndex >= 0 && dayIndex < 7 && duration > 0 1417 1421 width: eventWidth 1418 - height: isDeadline ? Math.max(8, Math.min(12, exactHeight)) : exactHeight 1422 + height: renderHeight 1419 1423 x: dayIndex * ((mainInstance?.dayColumnWidth) + (root.daySpacing)) + eventXOffset 1420 1424 y: startHour * (root.hourHeight) 1421 1425 z: 100 + overlapInfo.lane ··· 1436 1440 } 1437 1441 Loader { 1438 1442 anchors.fill: parent 1439 - anchors.margins: exactHeight < 10 ? 1 : Style.marginS 1440 - anchors.leftMargin: exactHeight < 10 ? 1 : Style.marginS + 3 1443 + anchors.margins: renderHeight < 12 ? 1 : Style.marginS 1444 + anchors.leftMargin: renderHeight < 12 ? 1 : Style.marginS + 3 1441 1445 sourceComponent: isDeadline ? deadlineLayout : (isCompact ? compactLayout : normalLayout) 1442 1446 } 1443 1447 } ··· 1448 1452 spacing: 2 1449 1453 width: parent.width - 3 1450 1454 NText { 1451 - visible: exactHeight >= 20 1455 + visible: renderHeight >= 20 1452 1456 text: (isTodoItem ? (model.todoStatus === "COMPLETED" ? "\u2611 " : "\u2610 ") : "") + model.title 1453 1457 color: eventTextColor 1454 1458 font.pointSize: Style.fontSizeXS; font.weight: Font.Medium ··· 1456 1460 elide: Text.ElideRight; width: parent.width 1457 1461 } 1458 1462 NText { 1459 - visible: exactHeight >= 30 && !isTodoItem 1463 + visible: renderHeight >= 30 && !isTodoItem 1460 1464 text: mainInstance?.formatTimeRangeForDisplay(model) || "" 1461 1465 color: eventTextColor 1462 1466 font.pointSize: Style.fontSizeXXS; opacity: 0.9 1463 1467 elide: Text.ElideRight; width: parent.width 1464 1468 } 1465 1469 NText { 1466 - visible: exactHeight >= 45 && model.location && model.location !== "" 1470 + visible: renderHeight >= 45 && model.location && model.location !== "" 1467 1471 text: "\u26B2 " + (model.location || "") 1468 1472 color: eventTextColor 1469 1473 font.pointSize: Style.fontSizeXXS; opacity: 0.8 ··· 1477 1481 NText { 1478 1482 text: { 1479 1483 var prefix = isTodoItem ? (model.todoStatus === "COMPLETED" ? "\u2611 " : "\u2610 ") : "" 1480 - if (exactHeight < 15) return prefix + model.title 1484 + if (renderHeight < 15) return prefix + model.title 1481 1485 if (isTodoItem) return prefix + model.title 1482 1486 return model.title + " \u2022 " + (mainInstance?.formatTimeRangeForDisplay(model) || "") 1483 1487 } 1484 1488 color: eventTextColor 1485 - font.pointSize: exactHeight < 15 ? Style.fontSizeXXS : Style.fontSizeXS 1489 + font.pointSize: renderHeight < 15 ? Style.fontSizeXXS : Style.fontSizeXS 1486 1490 font.weight: Font.Medium 1487 1491 font.strikeout: isTodoItem && model.todoStatus === "COMPLETED" 1488 1492 elide: Text.ElideRight; verticalAlignment: Text.AlignVCenter