-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathtodo.txt
219 lines (140 loc) · 7.87 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
zig 0.14:
- if sliceAsBytes/bytesAsSlice includes sentinel, then need to update our use
- if @src() gained a module field, then include it in the hash
check zig std lib for bytesAsSlice alignment - should it always aligncast?
doc comments and publish
update web-test and publish
redo screenshot
need to copy back out pixels from render targets to normal textures
make simple plot with option to save the image
- save to file on desktop, save to dataurl on web?
tooltips
need a way to get a string description of a keybind to display to user
alignment widget adds margin, but maybe should add a spacer instead?
- see if that makes the Text Entry example settle better
overhaul path construction so we don't maintain an implicit path
make textureCreate* properly return errors
can we save rendering commands and render to a texture we can get back?
- that would help plotting
- could make the demoButton's contents be static (cached images)
if (try dvui.button(@src(), "Export Texture", .{}, .{})) {
// set that texture as the target
_ = Backend.c.SDL_SetRenderTarget(backend.renderer, @ptrCast(G.tex));
// target back to screen
defer _ = Backend.c.SDL_SetRenderTarget(backend.renderer, null);
const pixels = try gpa.alloc(u8, dim * dim * 4);
defer gpa.free(pixels);
_ = Backend.c.SDL_RenderReadPixels(backend.renderer, null, 0, pixels.ptr, dim * 4);
var out_len: c_int = undefined;
const png_data = dvui.c.stbi_write_png_to_mem(pixels.ptr, dim * 4, dim, dim, 4, &out_len);
defer dvui.c.free(png_data);
var png_slice: []u8 = undefined;
png_slice.ptr = png_data;
png_slice.len = @intCast(out_len);
// base64 encode
const b64_encoder = std.base64.standard.Encoder;
const prefix = "data:image/png;base64,";
const encoded_size = prefix.len + b64_encoder.calcSize(@intCast(out_len));
var encoded = try gpa.alloc(u8, encoded_size);
encoded[0..prefix.len].* = prefix.*;
defer gpa.free(encoded);
_ = b64_encoder.encode(encoded[prefix.len..], png_slice);
//std.debug.print("output {s}\n", .{encoded});
//try dvui.openURL(encoded);
}
should do tabIndexSet if the element has size, so even if it's scrolled off the screen we still go to it
- when we do tabIndexNext/Prev it should focus that element and then also send a scroll_to message from that widget - how?
scrollContainer:
- doesn't do multiple widgets going horizontally
- rectFor or minSizeForChild
- add a direction to scrollContainer that controls the direction widgets are added in
lock_visible
- also take into account any viewport movement that frame from events/velocity
do some profiling of the scrolling demo and add caching to BoxWidget?
- add some profiling infrastructure?
- if cache is true and we are outside clipping rectangle, then can skip children and just go again with our minSize
add Options.id_override to forcefully set the id
- use in textEntryNumber
- use in reroder so things don't reset when they get dragged/dropped
- search for all uses of extendId
textLayout:
- check that min width/height works when there are top corner widgets (top left, top right, both) but no text
try to decouple background from border
consolidate touch editing selection
raylib backend
- directly call glfw.waitEventsTimeout?
- events
- instead of useTex, preload (or use raylib's) a 1x1 white texture
- use raylib's default shader (have to give up premultiplied alpha)
- on mac, two-finger scrolling in the demo window a lot hangs?
- enable by default
new theme fields
build needs an option to select backend?
touch dragging should probably not work when the size of the stuff inside the scroll area is less than the scroll area's size?
- otherwise you get lots of meaningless off-the-edge scrolling
README needs a section on themes
- and how the new fields interact
maybe toasts subwindow need some kind of outline?
test ability to scroll_drag on a touch screen - do we need a curtain area around the edge of the scrollarea/screen where touch events will cause a scroll drag?
web backend
- on phone chrome entering characters works, but backspace first removes characters from the keyboard buffer before we get them removed, something to do with IME
web backend clipboard
- ideally we should preventDefault on copy/paste events, then be able to access the clipboard
navigator.clipboard.readText().then(function (text) {
console.log("read: " + text);
});
maybe expand should be a f32 instead of bool
- could express "want this to take up 1/3 of the space"
- could function as weights for BoxWidget
text rendering:
- investigate if with stb_truetype we can align horizontally to pixels?
- see if the vertical weirdness is global, maybe a canvas size thing? Does it happen in the SDL demo?
add cursors to examples (row of buttons or something one for each cursor)
touch editing - when a paste or text insertion happens, toggle off the touch editing
on hidpi display, selecting a bunch of text leaves small gaps noticeable in the selection background
- only if the text is added char by char
paned should have an "autopos" mode where when not collapsed it will use the expand of the children to determine split
- this way you can have the split automatically be not 50/50
need a button for sizing/rotation for icon and raster that works continuously while you hold it down
- add option to Button where when in the down position it keeps refreshing
when new events come in, we assign the focus id, but probably shouldn't once we see a focus mouse event
need a strategy for activating paste from a menu, because the widget will lose focus when the menu is activated
- when the menu gets focus, maybe it saves the previous focus id?
- then when the paste menu item is clicked, it can send focus back to saved id
- also need to synthesize an event so that widget processes a paste
add inertia to scrolling
- if the scrollContainer has more intertia scrolling to do, then it should eat all pointer events, because we don't want any pointer events going to children if the scrolling is still happening
switch from my freetype fork to Mach's
maybe builtin button should record multiple clicks?
- helps in low framerate situations
TextLayout support for large documents
- need a function to say "we are skipping a bunch of bytes" (might be useful for code folding as well)
- addTextDone needs to not always set cursor because there might be lots of text remaining that we aren't rendering
add alpha to Options as well and multiply it by the theme alpha
add backend function to allow screensaver
Tooltips:
- wrapper around thing you want the tooltip for
- floating windows similar to popup
- popup has 3-4 states:
- ready (on first frame where the mouse pointer is above the rect, go to
showing)
- timer (could go here and wait for timer)
- showing (tooltip popup shows, go to off if the mouse pointer is not
above rect)
- off (go to ready on a frame where the mouse pointer is off our rect)
var ttw = ToolTipWidget.init...
- if (ttw.active()) |p| {
// p is the point of the mouse when the tooltip was activated
var ttp = TooltipPopupWidget.init... (pass in TooltipWidget's screenrect, optionally previous ttp if nested)
// ttp
ttp.install();
// tooltip contents
ttp.deinit();
// ttp.deinit() checks:
- if we have a live nested ttp, we stay alive
- if the current mouse pointer is not above ttp OR the passed in ttw screenrect, we stay alive
- if staying alive and we have a ttp parent, tell that parent we are live
}
xstart and ystart for textSize
kerning
when we have a widget that has captured the mouse, need to capture the mouse in the underlying window system so click-dragging works even when the mouse pointer goes outside the window