Commit graph

13 commits

Author SHA1 Message Date
hippoz
b0315b76be
add scrolling widgets 2022-07-05 20:07:09 +03:00
hippoz
3a9b530a08
remove automatic event propagation 2022-06-11 20:42:21 +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
1f04b5d1dc
begin working on adding invalidation rects 2022-06-04 12:12:41 +03:00
hippoz
5e436b5463
replace the separate layout and repaint events with a single "reflow"
event
2022-05-12 17:05:16 +03:00
hippoz
1aec5d3e44
☢️☢️☢️☢️☢️☢️ 2022-04-30 09:40:09 +03:00
hippoz
eedf38f9a8
add relayout event 2022-04-02 21:41:35 +03:00
hippoz
596b0e530f
switch to different painting method and add label widget 2022-03-26 02:57:41 +02:00
hippoz
736cef4667
Fix activation and use toplevelstyles inside of widgets 2022-03-20 02:47:15 +02:00
hippoz
ef85745f58
text, hover, styles and buttons! 2022-03-18 02:49:16 +02:00
hippoz
529c286b8f
dispatch repaint events and lay yet more groundwork 2022-03-09 20:02:18 +02:00
hippoz
b4cfe309f3
make window respond to events and lay more groundwork 2022-03-09 03:46:27 +02:00
hippoz
2cc5e1c1e0
basic structure 2022-03-08 02:25:22 +02:00