Commit graph

196 commits

Author SHA1 Message Date
Jonathan Johnson
a526dc000b
Fixing doc link 2023-12-10 07:21:28 -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
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
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
d1e21178e0
WeakDynamic<T> 2023-12-02 07:05:18 -08:00
Jonathan Johnson
9ee00106a3
Updated alot + Eq for CallbackHandle 2023-12-02 06:51:19 -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
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
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
0684ac59bf
Background input highlight fixes 2023-11-29 15:01:57 -08:00
Jonathan Johnson
b1ec2c5e49
Focus in bg 2023-11-29 14:52:17 -08:00
Jonathan Johnson
d23226ffe6
Updating kempt 2023-11-29 14:31:25 -08:00
Jonathan Johnson
9146c920ac
Expand and stack fixes 2023-11-29 11:43:52 -08:00
Jonathan Johnson
589c3dbc7f
MakeWidget for Dynamic<WidgetInstance> + option 2023-11-29 11:42:51 -08:00
Jonathan Johnson
c0d714331b
Merge branch 'main' of github.com:khonsulabs/gooey 2023-11-28 10:15:10 -08:00
Jonathan Johnson
8e19a89bca
Added font size + heading helpers 2023-11-28 10:14:55 -08:00
Jonathan Johnson
bb8b82404b
Fixing MacOS compilation 2023-11-28 07:06:12 -08:00
Jonathan Johnson
3f2aace55e
Debouncing 2023-11-27 10:09:42 -08:00
Jonathan Johnson
aeb55e0b94
run_in_bg and Dynamic<&'static str> 2023-11-27 09:27:37 -08:00
Jonathan Johnson
4d31719392
Merge pull request #75 from khonsulabs/feature/world-coords
world coords and hover state for tilemap (this is very much debug)
2023-11-26 19:31:49 -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
b63e4d66d2
Bug fixes 2023-11-22 18:53:41 -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
00cb29d261
Centering checkbox ornament 2023-11-22 10:55:33 -08:00
Jonathan Johnson
c9566fe1bd
Radio, Checkbox refactor 2023-11-22 10:48:26 -08:00
Jonathan Johnson
23ba9ce11f
Improved input editing 2023-11-22 08:16:54 -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