Commit graph

93 commits

Author SHA1 Message Date
hippoz
32524f01e2
add scrollcontainer hack for width 2022-07-26 01:06:19 +03:00
hippoz
533b6ebe91
remove png function as it was not very useful 2022-07-26 01:06:07 +03:00
hippoz
801482efbf
add hack for label 2022-07-26 01:05:51 +03:00
hippoz
6dd0a1338f
fix documentlayout automatic sizing 2022-07-26 01:05:37 +03:00
hippoz
59e8806c9e
clean up some of the imports 2022-07-26 01:05:21 +03:00
hippoz
3139582373
hopefully fix library dependencies 2022-07-26 01:04:16 +03:00
hippoz
c63d94a651
new install script 2022-07-26 01:03:51 +03:00
hippoz
711c244ef2 add png support 2022-07-17 23:17:12 +03:00
hippoz
5663552527 make raven a shared library and make an arch linux package 2022-07-12 00:05:30 +03:00
hippoz
2fa09abbf2
further improve boxlayout 2022-07-11 02:57:49 +03:00
hippoz
4f35de353e
remove unnecessary reflows when adding widgets 2022-07-10 04:30:42 +03:00
hippoz
45e322f947
further modify box layout to better support minimum and maximum sizes 2022-07-10 03:40:05 +03:00
hippoz
a869385d09
modify box layout to better support of minimum and maximum sizes of widgets, still super janky 2022-07-10 00:18:12 +03:00
hippoz
1ceb227165
respect slotted widget rectangle extents in boxlayout
currently thinking of a way to make unslotted widgets respect minimum
and maximum extents.
2022-07-09 20:19:09 +03:00
hippoz
3ab3e74cd1
improve box layout unslotted widget justification 2022-07-08 15:32:07 +03:00
hippoz
43bbc4ddff
add box layout 2022-07-07 18:29:35 +03:00
hippoz
2423645222
aaaa 2022-07-06 03:43:19 +03:00
hippoz
72720d216d
document layout automatic resize 2022-07-06 03:41:00 +03:00
hippoz
a1f544ae82
add joke example program 2022-07-05 20:53:26 +03:00
hippoz
b0315b76be
add scrolling widgets 2022-07-05 20:07:09 +03:00
hippoz
0b4b3b1332
add resize_fixed() function for widgets 2022-06-15 21:15:29 +03:00
hippoz
88849ea766
Improve main widget resize behavior in Window 2022-06-15 19:16:04 +03:00
hippoz
c4d9672e0b
Add VerticalBoxLayout automatic sizing and modify demo program 2022-06-15 19:15:19 +03:00
hippoz
2c15569339
slightly reduce amount of work needed when painting text or rectangles 2022-06-15 18:26:07 +03:00
hippoz
b37e587808
reduce default button border radius 2022-06-15 18:25:26 +03:00
hippoz
ba29515720
don't use a rounded rectangle when drawing the background of a widget 2022-06-15 18:24:54 +03:00
hippoz
6d87a782ca
add the new box layouts to the meson build file 2022-06-15 18:24:17 +03:00
hippoz
c997f632c6
add widget accent style 2022-06-15 04:45:21 +03:00
hippoz
9a739d7cb4
improve performance when modifying text 2022-06-15 04:45:12 +03:00
hippoz
91a3ed6a87
add unfinished vertical box layout 2022-06-15 04:44:55 +03:00
hippoz
96a7739341
add horizontal box layout 2022-06-15 04:44:37 +03:00
hippoz
93b33c433b
remove redundant computation for window_relative 2022-06-14 01:48:02 +03:00
hippoz
ac340869a7
switch to older example program for testing 2022-06-14 01:46:58 +03:00
hippoz
2a5ae1f100
add a simpler example program 2022-06-12 23:40:04 +03:00
hippoz
c96fc98f37
export colors 2022-06-12 23:39:48 +03:00
hippoz
cd38bad6ea
fix DocumentLayout 2022-06-12 23:39:38 +03:00
hippoz
23bde79967
improve styles 2022-06-12 22:16:26 +03:00
hippoz
3a9b530a08
remove automatic event propagation 2022-06-11 20:42:21 +03:00
hippoz
69d8e0a689
tidy: tidy Painter's text() and compute_text_size() methods 2022-06-11 16:19:02 +03:00
hippoz
9ee4acfba5
tidy: rename current_geometry to rect and tidy includes 2022-06-11 15:56:26 +03:00
hippoz
305279c0f7
add improved style system for widgets 2022-06-11 15:52:23 +03:00
hippoz
bfe126ab3c
cleanup 2022-06-10 20:28:03 +03:00
hippoz
94c0be051b
Add "invalidation rectangle"-based repainting
Previously, we were repainting each widget as repainting was needed.
However, this created issues with clipping, since the widgets were not
aware of their parent's clips. It also created many other issues, including
performance problems and the lack of support for overlapping widgets.

This commit improves repainting behavior by adopting a painting model similar
to the one found in SerenityOS's LibGUI. It uses "damage rectangles", which
are translated to the widget coordinate space as needed, since the position of
widgets is relative to their parent's origin.
When a widget needs to be repainted, a repaint event with the damage
rectangle equal to the widget's current geometry translated to the window's coordinate
space is dispatched to the main widget. It will recursively follow the widget tree.
Widgets fully contain their children, thus widgets not contained by the damage
rectangle will reject the event, ensuring repainting is only done where needed.
Relayouting is done on a per-subtree basis only.

This commit should pave the way for things like scrolling
and overlapping widgets.
2022-06-10 19:42:03 +03:00
hippoz
f14d88c776
fix bounds check for focus event 2022-06-06 00:03:01 +03:00
hippoz
1f04b5d1dc
begin working on adding invalidation rects 2022-06-04 12:12:41 +03:00
hippoz
b781db009a
clean up class header files 2022-05-15 10:54:30 +03:00
hippoz
a01a3c1927
add an property to widgets to make them omit layout...
and add on_event function pointer that users can set on any widgets to
act upon various events manually
2022-05-14 15:44:05 +03:00
hippoz
fbece08638
make fitting widgets to text a generic function and add it to label 2022-05-14 13:05:52 +03:00
hippoz
8251532938
don't dispatch activation/focus events if the status did not change
This commit prevents the dispatch of activation/focus events if the
status did not change. This eliminates useless repaints when mousing
around inside a button.
2022-05-14 11:31:57 +03:00
hippoz
c85c367e11
Greatly improve performance on startup or when operating on lots of
widgets

This commit introduces "batches", which makes Raven hold off on doing
full reflows until the batch is ended. When a window is created, a batch
is automatically started to ensure that no useless reflows are done
during initialization. The batch is automatically ended in window.run().
Users of the library can create and end batches as well. This commit
also factors out automatic scaling based on text size into set_text for
buttons (should be done for labels as well).
2022-05-13 17:33:53 +03:00