tangled
alpha
login
or
join now
dzming.li
/
noctalia-plugins
0
fork
atom
Personal noctalia plugins collection
0
fork
atom
overview
issues
pulls
pipelines
Revert todo line style but keep non-overlap lanes
Dzming Li
2 weeks ago
1a731775
d2438c23
+16
-87
2 changed files
expand all
collapse all
unified
split
weekly-calendar
Main.qml
Panel.qml
-1
weekly-calendar/Main.qml
···
313
313
calendarUid: todo.calendarUid,
314
314
todoStatus: todo.status,
315
315
todoPriority: todo.priority,
316
316
-
isLineTodo: !isDueAllDay,
317
316
// Helper flags for compact rendering in Panel.qml
318
317
isDeadlineMarker: !isDueAllDay
319
318
}
+16
-86
weekly-calendar/Panel.qml
···
1409
1409
property real eventXOffset: overlapInfo.xOffset
1410
1410
1411
1411
property bool isTodoItem: model.isTodo || false
1412
1412
-
property bool isTodoLine: isTodoItem && (model.isDeadlineMarker || model.isLineTodo || false)
1413
1413
-
property bool isDeadline: (model.isDeadlineMarker || false) && !isTodoLine
1412
1412
+
property bool isDeadline: model.isDeadlineMarker || false
1414
1413
property color eventColor: isDeadline ? Color.mSecondary : (isTodoItem ? Color.mSecondary : Color.mPrimary)
1415
1414
property color eventTextColor: isDeadline ? Color.mOnSecondary : (isTodoItem ? Color.mOnSecondary : Color.mOnPrimary)
1416
1416
-
property real todoLineThickness: Math.max(2, 2 * Style.uiScaleRatio)
1417
1417
-
property real todoLabelGutter: {
1418
1418
-
var available = Math.max(eventWidth - 12, 0)
1419
1419
-
var base = Math.min(Math.max(eventWidth * 0.5, 80 * Style.uiScaleRatio), 150 * Style.uiScaleRatio)
1420
1420
-
var gutter = Math.min(base, available)
1421
1421
-
if (gutter <= 0 && available > 0) gutter = Math.min(available, 40 * Style.uiScaleRatio)
1422
1422
-
return gutter
1423
1423
-
}
1424
1415
1425
1416
visible: dayIndex >= 0 && dayIndex < 7 && duration > 0
1426
1417
width: eventWidth
1427
1427
-
height: isTodoLine ? Math.max(todoLineThickness + 10, 18 * Style.uiScaleRatio)
1428
1428
-
: (isDeadline ? Math.max(8, Math.min(12, exactHeight)) : exactHeight)
1418
1418
+
height: isDeadline ? Math.max(8, Math.min(12, exactHeight)) : exactHeight
1429
1419
x: dayIndex * ((mainInstance?.dayColumnWidth) + (root.daySpacing)) + eventXOffset
1430
1420
y: startHour * (root.hourHeight)
1431
1431
-
z: (isTodoLine ? 300 : 100) + overlapInfo.lane
1421
1421
+
z: 100 + overlapInfo.lane
1432
1422
1433
1433
-
Item {
1423
1423
+
Rectangle {
1434
1424
anchors.fill: parent
1435
1435
-
clip: false
1436
1436
-
1425
1425
+
color: eventColor
1426
1426
+
radius: Style.radiusS
1427
1427
+
opacity: isDeadline ? 0.95 : (isTodoItem && model.todoStatus === "COMPLETED" ? 0.5 : 0.9)
1428
1428
+
clip: true
1437
1429
Rectangle {
1430
1430
+
visible: exactHeight < 5 && overlapInfo.lane > 0
1438
1431
anchors.fill: parent
1439
1439
-
visible: !isTodoLine
1440
1440
-
color: eventColor
1441
1441
-
radius: Style.radiusS
1442
1442
-
opacity: isDeadline ? 0.95 : (isTodoItem && model.todoStatus === "COMPLETED" ? 0.5 : 0.9)
1443
1443
-
clip: true
1444
1444
-
Rectangle {
1445
1445
-
visible: exactHeight < 5 && overlapInfo.lane > 0
1446
1446
-
anchors.fill: parent
1447
1447
-
color: "transparent"
1448
1448
-
radius: parent.radius
1449
1449
-
border.width: 1
1450
1450
-
border.color: eventColor
1451
1451
-
}
1432
1432
+
color: "transparent"
1433
1433
+
radius: parent.radius
1434
1434
+
border.width: 1
1435
1435
+
border.color: eventColor
1452
1436
}
1453
1453
-
1454
1437
Loader {
1455
1438
anchors.fill: parent
1456
1456
-
anchors.margins: isTodoLine ? 0 : (exactHeight < 10 ? 1 : Style.marginS)
1457
1457
-
anchors.leftMargin: isTodoLine ? 0 : (exactHeight < 10 ? 1 : Style.marginS + 3)
1458
1458
-
sourceComponent: isTodoLine ? todoLineLayout : (isDeadline ? deadlineLayout : (isCompact ? compactLayout : normalLayout))
1439
1439
+
anchors.margins: exactHeight < 10 ? 1 : Style.marginS
1440
1440
+
anchors.leftMargin: exactHeight < 10 ? 1 : Style.marginS + 3
1441
1441
+
sourceComponent: isDeadline ? deadlineLayout : (isCompact ? compactLayout : normalLayout)
1459
1442
}
1460
1443
}
1461
1444
···
1504
1487
font.strikeout: isTodoItem && model.todoStatus === "COMPLETED"
1505
1488
elide: Text.ElideRight; verticalAlignment: Text.AlignVCenter
1506
1489
width: parent.width - 3
1507
1507
-
}
1508
1508
-
}
1509
1509
-
1510
1510
-
Component {
1511
1511
-
id: todoLineLayout
1512
1512
-
Item {
1513
1513
-
anchors.fill: parent
1514
1514
-
clip: false
1515
1515
-
1516
1516
-
Rectangle {
1517
1517
-
id: line
1518
1518
-
anchors.left: parent.left
1519
1519
-
anchors.right: parent.right
1520
1520
-
anchors.rightMargin: todoLabelGutter
1521
1521
-
anchors.verticalCenter: parent.verticalCenter
1522
1522
-
height: todoLineThickness
1523
1523
-
radius: todoLineThickness / 2
1524
1524
-
color: eventColor
1525
1525
-
opacity: model.todoStatus === "COMPLETED" ? 0.45 : 1.0
1526
1526
-
}
1527
1527
-
1528
1528
-
Rectangle {
1529
1529
-
id: leader
1530
1530
-
width: 12 * Style.uiScaleRatio
1531
1531
-
height: todoLineThickness
1532
1532
-
anchors.left: line.right
1533
1533
-
anchors.verticalCenter: line.verticalCenter
1534
1534
-
color: eventColor
1535
1535
-
opacity: line.opacity
1536
1536
-
}
1537
1537
-
1538
1538
-
Rectangle {
1539
1539
-
id: labelBox
1540
1540
-
anchors.left: leader.right
1541
1541
-
anchors.verticalCenter: line.verticalCenter
1542
1542
-
width: Math.max(todoLabelGutter - leader.width, 70 * Style.uiScaleRatio)
1543
1543
-
height: Math.max(todoLineThickness + Style.marginS, 18 * Style.uiScaleRatio)
1544
1544
-
radius: Style.radiusS
1545
1545
-
color: Color.mSurface
1546
1546
-
border.color: Qt.alpha(eventColor, 0.9)
1547
1547
-
border.width: 1
1548
1548
-
NText {
1549
1549
-
anchors.fill: parent
1550
1550
-
anchors.margins: Style.marginS / 2
1551
1551
-
text: (model.todoStatus === "COMPLETED" ? "\u2611 " : "\u2610 ") + (model.title || "")
1552
1552
-
color: eventColor
1553
1553
-
font.pointSize: Style.fontSizeXXS
1554
1554
-
font.weight: Font.Medium
1555
1555
-
font.strikeout: model.todoStatus === "COMPLETED"
1556
1556
-
elide: Text.ElideRight
1557
1557
-
verticalAlignment: Text.AlignVCenter
1558
1558
-
}
1559
1559
-
}
1560
1490
}
1561
1491
}
1562
1492