Phase 2 fix: calendar week numbers + tree expander

- Calendar: show-week-numbers now actually draws the ISO week
  numbers (44-49 for Nov 2026) in the left column; the column
  width was reserved but the numbers were never painted.
- TreeView: the expander triangle is only drawn on rows that have
  children (next row starts with path + "/"); leaf rows like
  "Other" no longer get a spurious triangle.
This commit is contained in:
cnmcdee committed 2026-12-01 02:44:56 +00:00
1 parent 7717194cbd
commit 5692908b7b
1 file changed
+9 -2
+9 -2
View File
@@ -1496,8 +1496,9 @@ class ListSelWidget(Widget):
cr.rectangle(1, y, self.width - 2, rh)
cr.fill()
x = 6 + depth * indent
if _prop_bool(self, "show-buttons", True) and depth == 0 \
and len(rows) > 1:
has_children = (i + 1 < len(rows)
and rows[i + 1].startswith(path + "/"))
if _prop_bool(self, "show-buttons", True) and has_children:
_triangle(cr, x + 4, y + rh / 2, 8,
"down" if i == 0 else "right")
x += 12
@@ -1809,6 +1810,12 @@ class ContainerWidget(Widget):
y += 16
row_h = max(14, (self.height - y - 2) / 6.0)
for row in range(6):
if show_week:
from datetime import timedelta as _td
monday = first + _td(days=row * 7 - start_col)
_wtext(cr, self, str(monday.isocalendar()[1]),
14, y + row * row_h + row_h / 2 + 4, size=10,
align="center", rgb=(0.5, 0.5, 0.5))
for col in range(7):
day = row * 7 + col - start_col + 1
cx = x0 + col * col_w