Commit graph

42 commits

Author SHA1 Message Date
Jonathan Johnson
76a42e2788
Updated to wgpu 0.19.0
Most of the changes were figures-related. Go figure.
2024-01-18 06:37:29 -08:00
Jonathan Johnson
6ad6cca32d
Children renamed to WidgetList
Plus more work on the user's guide, which inspired the rename.
2024-01-09 13:26:14 -08:00
Jonathan Johnson
be0399279c
Initial implementation of offscreen rendering 2024-01-03 11:35:43 -08:00
Jonathan Johnson
83e44912ee
ReadOnly<T>, Owned<T>, IntoSource<T>, more
Closes #98

This finishes my initial refactoring of the dynamic system to add
support for several dataflows including:

- Pure data sources that can be implemented using an `Owned<T>` at the
  root of a graph of `Dynamic<U>`/`DynamicReader<U>`s.
- Read-only data sinks. I thought this would be more useful across other
  widgets, but in general, Progress and Label seem like the only types
  that this applies to currently.
- The ability to mix/match Dynamic/DynamicReader in tuple-based
  for_each/map_each.
2024-01-02 14:36:53 -08:00
Jonathan Johnson
9e4e079bf5
WindowLocal + Custom Observers
This cascaded into a lot more work than expected. However, in general,
if one clones a `WidgetInstance` and shares it between two windows, it
should now work. Widget authors must ensure that when they cache
information, they do so with either a `WidgetCacheKey` or use a
`WindowLocal<T>` if per-window state is desired.

This is demonstrated in the debug-window example, where the counter of
open windows is next to a clone of the same button from the main window
that opens a new window.
2023-12-29 13:21:39 -08:00
Jonathan Johnson
2fe28729df
Directly depending on figures
While this was a workaround for a docs.rs issue (Px/Lp are not
linked), I decided having the shorter import path would look better in
the examples.

It probably wasn't necessary to update all of the references in the
internal code, but I decided it was worth the consistency.
2023-12-28 09:35:24 -08:00
Jonathan Johnson
2575deecf8
Removed TODOs that are now issues 2023-12-20 11:03:48 -08:00
Jonathan Johnson
27d5594776
Fixed odd padding rounding issues
The Container code was causing small rounding errors when laying out
that would cause the layout to sometimes me larger by a pixel. I
searched for all locations we are applying padding and added rounding
calls.

Refs #92
2023-12-19 15:20:02 -08:00
Jonathan Johnson
02d6b343f1
Widget docs + refactoring
- MakeWidgetWithId::make_with_id -> MakeWidgetWithTag::make_With_tag
- ManagedWidget -> MountedWidget
- *_refresh -> *_redraw, standardized on terminology
- get_tracked -> get_tracking_redraw
2023-12-17 07:38:31 -08:00
Jonathan Johnson
c4200e6009
Added MountedChildren 2023-12-14 07:48:56 -08:00
Jonathan Johnson
b1177e7c25
Gutter is now a property on Stack 2023-12-13 09:38:12 -08:00
Jonathan Johnson
0e6796318b
Added Widget::summarize
Debug printing widgets was quite verbose. While developing a widget, you
often want to see a full debug printout, but this feature assumes that
debug printing a WidgetInstance should show a summary of the widget, not
a full debug printout containing cached glyph information of every
label.

By default, summarize just calls Debug, but this extra layer allows
widgets to provide a more condensed summary and exclude details like
caches.

Originally, adding dbg!() around the theme example's UI yielded a
whopping 20,324 lines of text. The summary code only prints 3,858
lines.
2023-12-03 06:40:19 -08:00
Jonathan Johnson
8f99ae19fd
Implemented a basic grid
Refs #14
2023-11-30 18:19:53 -08:00
Jonathan Johnson
a826b91173
Fixing gutter calculations + scroll canvas sizing 2023-11-30 08:46:41 -08:00
Jonathan Johnson
03e93adb15
Select buttons 2023-11-29 17:14:42 -08:00
Jonathan Johnson
9146c920ac
Expand and stack fixes 2023-11-29 11:43:52 -08:00
Jonathan Johnson
0fd8a9487f
Validations 2023-11-25 07:43:04 -08:00
Jonathan Johnson
ecc08f3f73
Stack gutters honor IntrinsicPadding 2023-11-22 06:21:44 -08:00
Jonathan Johnson
bb66803653
Custom widget, layout size rounding
Closes #56
2023-11-20 10:11:10 -08:00
Jonathan Johnson
d5bde44e27
Subpixels + Feathering + figures refactor
Much curves
2023-11-19 10:34:06 -08:00
Jonathan Johnson
8ae315e229
Drawing refactor from Kludgine 2023-11-17 08:07:37 -08:00
Jonathan Johnson
947f1cd8a7
Stack with premeasured content now work
This makes nested scroll areas work correctly.
2023-11-15 07:47:23 -08:00
Jonathan Johnson
54e01f1911
Checkbox, ButtonKind, linked/linked_string + more 2023-11-14 20:39:29 -08:00
Jonathan Johnson
b72e4b0caf
Optimizing Stack layout in Known dimensions 2023-11-14 07:59:13 -08:00
Jonathan Johnson
a04619a279
Layout caching, Lerp underflow fix, label fix 2023-11-14 07:38:39 -08:00
Jonathan Johnson
ee3813f44d
Switcher, h/v expand 2023-11-13 09:14:38 -08:00
Jonathan Johnson
81f6f8c4d3
Theme example reacts 2023-11-10 18:11:31 -08:00
Jonathan Johnson
e471cb0ea5
Removing debug statements 2023-11-10 15:55:23 -08:00
Jonathan Johnson
95c1f2a01a
Fixing DimensionRange for ..= 2023-11-10 15:46:38 -08:00
Jonathan Johnson
60e85c78d0
Resize exact fix, stack overflow now works 2023-11-10 15:11:46 -08:00
Jonathan Johnson
e683b7d31f
fill(), expand at root, Space::colored 2023-11-10 12:20:56 -08:00
Jonathan Johnson
724f6d7b18
Resize now accepts ranges, Window honors Resize
Closes #62, Closes #63
2023-11-09 14:54:41 -08:00
Jonathan Johnson
1714948174
Styles are now reactive 2023-11-09 10:42:56 -08:00
Jonathan Johnson
8e268615a1
WrapperWidget, Space 2023-11-08 19:09:59 -08:00
Jonathan Johnson
bf9836a82b
Default + Cancel widgets 2023-11-08 11:03:17 -08:00
Jonathan Johnson
5e5d826267
Checkpoint
Progress on tab focus
2023-11-07 15:16:29 -08:00
Jonathan Johnson
fbf6134a0a
Initial window focus 2023-11-06 06:19:41 -08:00
Jonathan Johnson
0f6d3838b1
LayoutContext
measure() now is layout(). LayoutContext can either persist layout
information or be used temporarily for measurement. While this caching
is constantly thrown out currently, this is a step towards being able to
only re-layout widgets if they've been invalidated.
2023-11-05 11:50:59 -08:00
Jonathan Johnson
32b5e16695
Fixing size_to_fit unit test
Part of the refactor yesterday made Stack's size-to-fit behavior work in
both dimensions.
2023-11-03 07:21:17 -07:00
Jonathan Johnson
0026a6db0d
Resize/Expand rework + basic readme 2023-11-02 14:23:36 -07:00
Jonathan Johnson
79be9a063b
Scroll and Animations
Scroll is only working to the absolute barest of requirements.
2023-11-01 15:15:14 -07:00
Jonathan Johnson
93a9545cc4
Renamed Array to Stack 2023-10-30 21:41:14 -07:00
Renamed from src/widgets/array.rs (Browse further)