forked from Jaysce/Spaceman
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathTODO.txt
More file actions
97 lines (73 loc) · 4.42 KB
/
Copy pathTODO.txt
File metadata and controls
97 lines (73 loc) · 4.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
============================================================================
REFACTORING
============================================================================
StatusBar is large (~1000 lines) and handles menu construction, click handling,
scroll handling, tooltips, quick rename panels, Sparkle updates, shortcut display,
and grid vs list switching. It's doing a lot. Split or extract from StatusBar
(quick rename, menu construction, scroll handling could be separate).
============================================================================
SLANTED ICON SHAPES: triangles and trapezoids
============================================================================
Status: IDEA (2026-04-03)
Effort: Medium — custom NSBezierPath rendering, hit testing changes
Risk: Low — additive, new icon shape option alongside existing ones
--- What it is ---
A new decoration shape where icons have slanted/diagonal edges instead of
vertical ones. With short text (numbers), icons become triangles. With longer
text (names), they become trapezoids. The slant creates a distinctive,
dynamic look.
Numbers (triangles), without or with gaps:
_______ . _____ .
/ \ 5 / \ or / \\ 5 // \
/ 4 \ / 6 \ / 4 \\ // 6 \
‾‾‾‾‾‾‾‾‾‾‾ ‾‾‾‾‾ ' ‾‾‾‾‾
Names (trapezoids) without or with gaps:
___________________ ____ ________ _______
/ \ Five / \ or / \\ Five // \
/ Four \ / Private \ / Four \\ // Private \
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ ‾‾‾‾‾‾‾‾ ‾‾‾‾ ‾‾‾‾‾‾‾‾‾‾‾
Icons can tessellate (share slanted edges) or have gaps between them, like
the existing rectangular icons do.
--- Rendering ---
NSBezierPath can draw arbitrary polygons, so the shape itself is
straightforward — just a trapezoid/triangle path instead of the current
NSBezierPath(roundedRect:). Would be a new case in IconStyle or IconShape.
For each icon, the path would be:
- Top edge: shorter than bottom (or equal for rectangles)
- Left edge: slanted inward from bottom-left to top-left
- Right edge: slanted inward from bottom-right to top-right
- The slant angle is constant; the top width depends on the text width
Text is centered within the shape. For trapezoids this is approximately
the center of the bounding rect; for narrow triangles the text sits in
the wider bottom portion.
--- Considerations ---
1. Hit testing: IconWidth currently uses rectangular left/right bounds.
Slanted edges mean the actual clickable shape is a trapezoid. Two
approaches:
a) Keep rectangular hit zones (simpler, small visual mismatch at edges)
b) Add diagonal hit testing (more accurate, more code)
Option (a) is probably fine — the mismatch is 1-2px at the slant.
2. Interlocking vs gaps: The shapes can tessellate (each icon's right slant
is the next icon's left slant) or have gaps. Gaps are simpler since icons
remain independently rendered. Tessellation requires either rendering the
whole strip as one composite path or handling overlap between adjacent
icon images.
3. Two-row mode: Slanted shapes in two rows could alternate the slant
direction per row (top row: /‾\, bottom row: \_/) for a zig-zag effect.
Or both rows could slant the same way. Needs visual experimentation.
Or this shape could be unavailable in two-row mode.
4. Active/inactive distinction: The existing fill/border distinction works
naturally with trapezoid paths — filled trapezoids vs bordered trapezoids.
5. Fullscreen variant: Could use inverted slant (wider at top instead of
bottom) as the contrasting shape, analogous to how rectangular↔pill works
currently.
--- Implementation sketch ---
- Add a new IconShape case (e.g. .slanted) or a separate slant parameter
- In renderIcon(), when slanted: build an NSBezierPath with 4 points
instead of using roundedRect
- The slant inset = some fraction of the icon height (e.g. height * 0.3)
- Top-left = (slantInset, height), top-right = (width - slantInset, height)
- Bottom-left = (0, 0), bottom-right = (width, 0)
- For bordered: stroke the path. For filled: fill the path
- Text drawing unchanged (centered in bounding rect, close enough)
============================================================================