Commit graph

112 commits

Author SHA1 Message Date
Jonathan Johnson
353db9dc39
Added Opacity component
Closes #87
2023-12-13 14:02:39 -08:00
Jonathan Johnson
0adb43a234
Implemented local styles
Closes #86
2023-12-13 10:44:34 -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
79a09ee614
Shadow blur now can cause expansion
Rather than clip or cause shadows to be weirdly shaped, the shape is
adjusted if the blur radius is too large for the given geometry. This
ensures the shadows always draw correctly, but it also forces shadows to
render their full blur + spread gradients.
2023-12-12 19:27:41 -08:00
Jonathan Johnson
a7efe9a3d5
Container Shadows 2023-12-12 13:49:03 -08:00
Jonathan Johnson
c4151d649c
Added Spinner widget
Closes #80
2023-12-10 15:05:59 -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
95555ce928
Tilemap updates 2023-12-09 08:20:18 -08:00
Jonathan Johnson
16af20269e
Updated figures + kludgine 2023-12-07 15:49:03 -08:00
Jonathan Johnson
2fe08fc9e9
Added hover support to OverlayLayer 2023-12-07 09:51:07 -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
3f8885efbe
Callback handles are now managed
Installing a callback now returns a CallbackHandle. All map-style APIs
install this handle automatically on the created dynamic, which keeps
the callback installed until the dynamic is freed. All other APIs
return the handle for the caller to either call persist() or store
somewhere.

Now, the dynamic system can be used for application-long data with
almost no fear of leaking data due to how callbacks are being installed.
Technically cycles are still possible by moving clones into the
callbacks, so a WeakDynamic type might be worth exposing.
2023-12-01 13:31:42 -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
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
03e93adb15
Select buttons 2023-11-29 17:14:42 -08:00
Jonathan Johnson
63a4549f29
Tested buttons in buttons 2023-11-29 15:42:06 -08:00
Jonathan Johnson
ce6935a7a7
Making it easier to draw focus correctly 2023-11-29 15:08:12 -08:00
Jonathan Johnson
8e19a89bca
Added font size + heading helpers 2023-11-28 10:14:55 -08:00
Jonathan Johnson
66fd9ba766
Finished mouse handling for tile map 2023-11-26 19:31:03 -08:00
Jonathan Johnson
273aac65bb
Merge branch 'main' into feature/world-coords 2023-11-26 19:11:49 -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
0fd8a9487f
Validations 2023-11-25 07:43:04 -08:00
Jonathan Johnson
f107267409
Validations 2023-11-24 14:29:06 -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
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
ecc08f3f73
Stack gutters honor IntrinsicPadding 2023-11-22 06:21:44 -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
eee336eab0
Progress values are easier to work with 2023-11-21 19:36:00 -08:00
Jonathan Johnson
801337ab7a
Progress bars, repeating animations
Closes #70
2023-11-21 09:53:08 -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
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
c39f8f33ad
Rewrote text input
Also implemnted secure/masked input

Closes #58
2023-11-16 15:34:26 -08:00
Jonathan Johnson
a8841e6f1c
Merge branch 'main' into feature/world-coords 2023-11-15 18:45:39 -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
5965f19d27
Reverting back to default app state 2023-11-15 09:38:27 -08:00
Jonathan Johnson
5a9aa6b55d
Tic-tac-toe, Buttons labels now stretch to fill 2023-11-15 09:32:28 -08:00
Jonathan Johnson
bc83b81687
Add transparent button to buttons example 2023-11-15 08:01:09 -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