-
Notifications
You must be signed in to change notification settings - Fork 2
/
TODO.txt
114 lines (100 loc) · 2.82 KB
/
TODO.txt
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
BUGS
------------------------------------------------------------------------------
- set_cursor() must be set in draw? hittest? where?
- grid drawing is stateful (awaiting impl. of secondary cmd streams)
- toolbox move by all sides, with all alignment combinations
- toolbox dynamic z-index
THINK
- solve the IMGUI achilles heel:
widgets depending on the state of other widgets that appear later in the frame.
solutions:
- cmd record buffers
- events
- forced re-layouting without redrawing
- update callback when reading state(id)
- bb on text
- bb on scrollbox?
- negative margins?
- separate available APIs for each phase
- make drawing phase stateless
-
------------------------------------------------------------------------------
GOALS
* drag & drop UI designer
- templates with conditionals, repeats and sub-templates
- template-based widgets
* IMGUI with popups and layouting
* remote screen sharing
* with input routing
- with client-side themes
IMGUI
- drawing
* z-index
* text
* bg-color
* border
* box-shadow
- images (incl. svg?)
- layouting
* min width & height
* flexbox fr stretch
* flexbox min-w/h grow
* flexbox align
* flexbox gap
* stack
* padding
* margin
* text min-w/h
* popup layouting
* word-wrapping
- grid fr stretch
- grid min-w/h grow
- grid align
- grid gap
- transition animations
- mouse
* hit-test rect
* hit state
* hit parents
* capturing
* capture state
* drag & drop
- keyboard
* focused state
- tab focusing
- event bubbling
- text selection
- drag-select with mouse
- text(area) input
* put it behind the canvas with correct width & height
- route keyboard events to it
* redraw it on canvas with offset and selection
CHALLENGES
* input on a canvas
- textarea on a canvas
* webgl2 canvas on a 2d canvas
* word wrapping (our layout algo supports word-wrapping for horizontal text)
- rich text on a canvas (inline box model)
PROS vs WEB
- stateless i.e. reactive / IMGUI (but with layouting and z-index and no frame lag)
- simpler and far more productive layouting and styling models
- global z-index, allowing for:
- relatively-positioned but painted-last popups
- painted-last focus ring
- transition animations for in-layout objects, allowing for:
- animated element moving, drag/drop and selection under/overlays
- streamable and replayable rendering, for sreen-sharing and remote interaction
- super-fast and memory-efficient with very low gc pressure between frames.
- complex widgets built with a combination of box-stacking and custom-drawing.
CONS vs WEB
- must reimplement:
* scrollbox
- text selection
- clipboard ops
* word-wrapping
- inline layouting with:
- u, b, i, strike, sub, sup, h1..6, p, br, hr, float
- no fancy typography:
- no smart word-wrapping (Thai, auto-hyphenation)
- no BiDi
- no smart underline (interrupted by letter descenders)