Commit graph

65 commits

Author SHA1 Message Date
Jonathan Johnson
0fd7c8fd5c
Implemented Wrap
Closes #59
2023-12-14 10:48:35 -08:00
Jonathan Johnson
353db9dc39
Added Opacity component
Closes #87
2023-12-13 14:02:39 -08:00
Jonathan Johnson
09a1590c7e
Finished font support
Font families are now cached. There probably should be a mechanism to
refresh the cache, but we don't currently have a "signal" to notify us
when a font is installed. Presumably, this could be something that
fontdb would eventually add, rather than us building our own.

Closes #48
2023-12-10 07:19:32 -08:00
Jonathan Johnson
35576f9214
Image widget
Closes #23

(Feels good to close a 3 year old issue!)
2023-12-09 13:18:46 -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
a3e45d1d86
Small improvements
- Caching font family resolution to avoid scanning the database over and
  over. The db should still be cached, but this makes repeated setting
  free.
- into_switcher rename for Dynamic<WidgetInstance> to avoid conflicting
  with Switchable::switcher()
- Dynamic debugging is less verbose
- IntoDynamic<Validation> for Result<T,E>
- Input no longer blinks cursor when disabled.
2023-12-01 12:52:46 -08:00
Jonathan Johnson
a826b91173
Fixing gutter calculations + scroll canvas sizing 2023-11-30 08:46:41 -08:00
Jonathan Johnson
bd37279282
Resizable windows now expand automatically
This expansion only triggers if the root widget measures larger than the
window's current size. We can't set a minimum size explicitly unless a
Resize widget is present, as we don't have enough knowledge to ensure
that the exact measurement we received was indeed the smallest layout in
any given direction. We only know that given the current constraints,
the returned measurement was the smallest possible. All future queries
will have to still be done again, as any change to the constraints could
impact the measured size.
2023-11-29 19:05:43 -08:00
Jonathan Johnson
d23226ffe6
Updating kempt 2023-11-29 14:31:25 -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
b2fdf06e60
Dynamic now requires PartialEq
This reduces the complexity of operations capable with Dynamic, and also
makes it easier to shortcut deadlocking operations.
2023-11-23 11:53:59 -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
9c1c77f9b1
Updated winit 2023-11-20 06:32:58 -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
8ae315e229
Drawing refactor from Kludgine 2023-11-17 08:07:37 -08:00
Jonathan Johnson
1ed1a95a1d
Input copy/paste works now
Also updated to wgpu 0.18.1
2023-11-15 14:25:59 -08:00
Jonathan Johnson
70eecb7429
Focus is now blurred when disabled
apply_pending_state now checks that the focused widget is still enabled.
If not, it transitions to no focus.
2023-11-15 13:43:26 -08:00
Jonathan Johnson
42840b950c
Hover updates after widget removal
This also fixes some inconsistencies that arose when the focus widget
was "stuck" on a removed widget. Button previously handled it hackily in
a redraw function, but now Gooey handles it automatically without
needing to wait for a repaint.
2023-11-15 12:41:41 -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
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
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
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
0610466964
Fixing check for resizable in window 2023-11-11 16:53:41 -08:00
Jonathan Johnson
019412543c
Lerp for ThemeMode 2023-11-11 13:47:35 -08:00
Jonathan Johnson
27d5baef5d
ThemeMode 2023-11-11 13:41:34 -08:00
Jonathan Johnson
e471cb0ea5
Removing debug statements 2023-11-10 15:55:23 -08:00
Roland Fredenhagen
244be0cf06
Support transparent windows 2023-11-11 00:31:03 +01:00
Jonathan Johnson
e44872351d
Using the actual size when auto-resizing 2023-11-10 14:09:37 -08:00
Jonathan Johnson
e683b7d31f
fill(), expand at root, Space::colored 2023-11-10 12:20:56 -08:00
Jonathan Johnson
d7384b63d8
Added WIP theming system 2023-11-10 09:39:33 -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
85928675ab
AutoFocusableControls, LayoutOrder 2023-11-09 08:51:24 -08:00
Jonathan Johnson
58b98a9a16
LinearInterpolation now requires PartialEq
This also means that if an animation is animating over discrete values
and the actual value has not changed, the Dynamic will no longer detect
a change because it's now using update instead of set.
2023-11-09 07:46:02 -08:00
Jonathan Johnson
22fb955dca
More combinators
Maybe I went overboard.
2023-11-08 20:10:01 -08:00
Jonathan Johnson
9596eaac17
Embracing tracing 2023-11-08 16:16:08 -08:00
Jonathan Johnson
bf9836a82b
Default + Cancel widgets 2023-11-08 11:03:17 -08:00
Jonathan Johnson
5e055376e7
Re-exposing attributes for now 2023-11-08 09:35:17 -08:00
Jonathan Johnson
fc165628e5
Input no longer blinks in the background
Also, Expand now expands properly.
2023-11-08 08:44:16 -08:00
Jonathan Johnson
b27b9db380
IntoDynamic<T> 2023-11-08 07:44:10 -08:00
Jonathan Johnson
57a689b8c8
Window focus/occlusion, recursive focus/activation 2023-11-07 20:16:59 -08:00
Jonathan Johnson
5e5d826267
Checkpoint
Progress on tab focus
2023-11-07 15:16:29 -08:00