Commit graph

66 commits

Author SHA1 Message Date
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
01e04a4eb9
Improving the readmes a bit 2023-12-15 14:31:44 -08:00
Jonathan Johnson
d7d0d6eb56
Squashed some todos 2023-12-14 17:30:40 -08:00
Jonathan Johnson
0fd7c8fd5c
Implemented Wrap
Closes #59
2023-12-14 10:48:35 -08:00
Jonathan Johnson
c4200e6009
Added MountedChildren 2023-12-14 07:48:56 -08:00
Jonathan Johnson
aa996a090b
Tooltips
Closes #37
2023-12-13 16:30:34 -08:00
Jonathan Johnson
cd4bb5130f
Widget::full_control_redraw
+ transparent containers show their shadows properly
2023-12-13 14:45:56 -08:00
Jonathan Johnson
5c720e6009
Align + Overlay + Shadow fixes
- Blur no longer expands the shadow geometry, but instead is clamped to
  avoid overlapping drawing calls.
- Overlay now handles hit tests correctly with regards to the original
  relative widget.
- Align was using an Into conversion that wasn't actually correct,
  causing the contents to not actually get aligned in some situations.
2023-12-13 08:26:09 -08:00
Jonathan Johnson
a7efe9a3d5
Container Shadows 2023-12-12 13:49:03 -08:00
Jonathan Johnson
0d34924ddf
OverlayLayer
Refs #37
2023-12-06 15:53:25 -08:00
Jonathan Johnson
288119a831
Added Layers 2023-12-05 08:51:55 -08:00
Jonathan Johnson
17847d6947
Various fixes/improvements
- On Linux, `fm-match` is used to query for the default fonts.
- DynamicComponents now have their own trait and can now be specified
  with a constant or dynamic.
- Roboto Flex is now always loaded when the feature is enabled.
  Overriding the default sans serif font prefers the overridden value,
  then roboto, then the result of fc-match/fontdb's default.
- Button now supports background colors being set on a transparent
  button.
2023-12-03 15:35:37 -08:00
Jonathan Johnson
55eea5fad3
Added Copy to Clipboard to theme editor
This also wires up the beginnings of the application type
2023-12-03 07:38:56 -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
8a4c66e73b
Refactored to MakeWidgetWithId 2023-11-30 09:14:19 -08:00
Jonathan Johnson
9146c920ac
Expand and stack fixes 2023-11-29 11:43:52 -08:00
Jonathan Johnson
8e19a89bca
Added font size + heading helpers 2023-11-28 10:14:55 -08:00
Jonathan Johnson
e15ae59c5c
Refactored root resize behavior
Closes #84, Closes #77, Closes #78
2023-11-25 12:00:59 -08:00
Jonathan Johnson
f107267409
Validations 2023-11-24 14:29:06 -08:00
Jonathan Johnson
15480ba68b
Added Collapse widget
Also tweaked progress bar animation
2023-11-22 15:46:58 -08:00
Jonathan Johnson
3e651c2964
CursorIcon + disabled refactoring
Input can now accept focus while disabled, and all controls should do
the right thing with regard to cursor icons now.
2023-11-22 12:06:29 -08:00
Jonathan Johnson
c9566fe1bd
Radio, Checkbox refactor 2023-11-22 10:48:26 -08:00
Jonathan Johnson
dd38fa7bf4
More fluent APIs 2023-11-22 05:54:35 -08:00
Jonathan Johnson
46a0758d09
Vertical sliders/progress bars
Also fixed checkbox layout after Label no longer pads itself.
2023-11-21 20:41:56 -08:00
Jonathan Johnson
2201f2c83b
Ranged sliders, advance_focus, allow_blur
Closes #60

Stepping in sliders is a compromise due to the flexibility of the
current slider implementation. I don't want to force types to implement
Add, and I don't like forcing types to require a Step (ie, what's the
appropriate value for f32 to specify as its next value?). Using a
percentage combined with lerp keeps the implementation fairly
straightfoward, although I remember experiencing this type of
configuration in another UI framework a long time ago and thinking it
was a little annoying to work with.

Ultimately, setting actual step boundaries can be done by customizing
the type that the slider is operating over. I feel like that's a much
more powerful design than I've experienced in previous frameworks, so
I'm hoping this percent step behavior is a reasonable compromise.
2023-11-20 19:44:03 -08:00
Jonathan Johnson
bb66803653
Custom widget, layout size rounding
Closes #56
2023-11-20 10:11:10 -08:00
Jonathan Johnson
4af82ae188
Component type safety, some font support 2023-11-19 21:52:45 -08:00
Jonathan Johnson
d5bde44e27
Subpixels + Feathering + figures refactor
Much curves
2023-11-19 10:34:06 -08:00
Jonathan Johnson
294b1350c4
Fixing button animations being "slow"
The issue was that my last set of changes were causing the animations to
restart, causing the animation to keep being extended to another 150ms.

I think the only way for this to work is to switch to an event
mechanism to notify widgets once they've been invalidated. This event
could include a parameter stating whether it was a direct invalidation
or an invalidation due to another widget in the hierarchy. Button
doesn't really care about the rest of the hierarchy, it only cares about
its own state, and the cache key was including too many changes.
2023-11-15 13:04:28 -08:00
Jonathan Johnson
5506a24dae
Added WidgetCacheKey 2023-11-15 10:36:00 -08:00
Jonathan Johnson
534f676ef0
Enable/disable is now handled for all widgets
Closes #66
2023-11-15 10:23:42 -08:00
Jonathan Johnson
54e01f1911
Checkbox, ButtonKind, linked/linked_string + more 2023-11-14 20:39:29 -08:00
Jonathan Johnson
eb063c82f0
Explicit focus order is now fully supported 2023-11-14 14:12:12 -08:00
Jonathan Johnson
4a4bc5de1a
Added slidable enum demo
Also moved into_button to MakeWidget
2023-11-14 11:44:32 -08:00
Jonathan Johnson
4c7c3be5ba
Helpers galore 2023-11-14 09:31:56 -08:00
Jonathan Johnson
a04619a279
Layout caching, Lerp underflow fix, label fix 2023-11-14 07:38:39 -08:00
Jonathan Johnson
40343e163f
Scroll fixes, resize helpers 2023-11-13 11:30:45 -08:00
Jonathan Johnson
ee3813f44d
Switcher, h/v expand 2023-11-13 09:14:38 -08:00
Jonathan Johnson
07b93397c5
Optimizations 2023-11-12 19:54:10 -08:00
Jonathan Johnson
96d407ddc2
Container, query_parent_style 2023-11-12 13:37:32 -08:00
Jonathan Johnson
2a50bb32d4
define_components embrace, sanitize, docs, export 2023-11-12 09:21:49 -08:00
Jonathan Johnson
6220394df2
Merge branch 'main' into button-fun 2023-11-11 20:18:06 -08:00
Roland Fredenhagen
83cb88925a
Make button take MakeWidget 2023-11-12 00:38:43 +01:00
Jonathan Johnson
27d5baef5d
ThemeMode 2023-11-11 13:41:34 -08:00
Jonathan Johnson
81f6f8c4d3
Theme example reacts 2023-11-10 18:11:31 -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
a2e28cb522
Dynamic::take, align helpers, scroll fix
Scroll was previously taking the graphics region as its control size as
opposed to the constraints. This was due to this code originally living
in redraw. This fixes scroll areas being able to scroll their contents
fully when sharing window space with other widgts.
2023-11-09 10:04:09 -08:00
Jonathan Johnson
a818cc41fd
TileMap focus, Style helpers 2023-11-09 06:58:58 -08:00
Jonathan Johnson
22fb955dca
More combinators
Maybe I went overboard.
2023-11-08 20:10:01 -08:00