Commit graph

432 commits

Author SHA1 Message Date
Jonathan Johnson
4bc3f5a884
Refactored VirtualList
These set of changes attempt to resolve a few complexities from the
original implementation: sizing and how to dynamically update the
content in the list.

On the sizing front, manually specifying the width and height of the
rows felt like it was more complex than measuring the first widget and
using that for all other widgets. This allows a user who wants to force
an explicit size to use the Resize widget, while also supporting
SizeToFit flows. Additionally, this paves the way for us to add
horizontal scrolling to this list, but this commit was already complex
enough I held off on that change for now.

One workflow I wanted to see supported was going from 0 rows to 50 rows.
When the item count comes from a trait, it was pretty complicated to
determine how to tell the list to ask for a new row count. By having the
user provide a Value<usize>, they can provide a `Dynamic<usize>` that
can be updated with a new row count whenever the application determines
there is new data. We still need to figure out a way to force a refresh
of the data even if the row count doesn't change.

Ultimately changing this allowed removing the trait and seemingly
simplified the basic usage in addition to adding more flexibility.
2024-11-07 14:27:08 -08:00
Daniel Bulant
4f742cd18b
add simple virtual list widget 2024-10-25 22:22:15 +02:00
Jonathan Johnson
d032299fc5
Document mouse event handling more thoroughly
Refs #198
2024-10-25 10:00:57 -07:00
Jonathan Johnson
0fe7f78969
Consistently apply overridden theme
Refs #196
2024-10-24 07:34:27 -07:00
Jonathan Johnson
0e0c26fa3b
Fixing Slider sizing when fully SizeToFit
Fixes #197
2024-10-23 10:48:09 -07:00
Jonathan Johnson
62dded16ef
GraphicsContext::fill fix
Fixes #193

Not really sure why this existed -- all attempts at reasoning at this
choice today are met with me scratching my head.
2024-10-22 08:09:11 -07:00
Jonathan Johnson
6cf3039983
Merge branch 'main' of github.com:khonsulabs/gooey 2024-10-22 06:12:38 -07:00
Jonathan Johnson
a3f5b6e3d2
Removing debug println 2024-10-22 06:12:21 -07:00
Jonathan Johnson
9cf93b2352
Merge pull request #195 from bluenote10/use_consistent_symbol_for_winit_window
Use consistent symbol to refer to winit window
2024-10-22 06:10:55 -07:00
Fabian Keller
ce836b2746 Use consistent symbol to refer to winit window 2024-10-22 10:01:58 +02:00
Fabian Keller
76fb062107 Fix some docstrings in window module 2024-10-22 09:57:39 +02:00
Jonathan Johnson
f08b7064ec
Merge pull request #191 from hydra/add-clear-to-widget-list
Add `clear` to `WidgetList`
2024-10-19 13:50:18 -07:00
Dominic Clifton
e88b0d4027 Add clear to WidgetList 2024-10-19 22:44:21 +02:00
Jonathan Johnson
bc54893c1c
Disable resizable automatically with fixed roots
Closes #188
2024-10-19 09:10:12 -07:00
Jonathan Johnson
171cf3f733
Refactor ScrollBars to their own widget
Closes #181
2024-10-19 08:16:26 -07:00
Jonathan Johnson
5adb37d2f1
Merge branch 'virtual-scroll-list-example' 2024-10-17 09:47:35 -07:00
Jonathan Johnson
51649a3c05
Refactored Scroll to be UPx
Also addressed comments in #185
2024-10-17 09:46:32 -07:00
Jonathan Johnson
5a5f6c9229
Fixed clipping of widgets with negative origins
Fixes #183
2024-10-17 08:54:12 -07:00
Jonathan Johnson
02e60e1049
IntoWidgetList
Fixes #182
2024-10-16 15:59:18 -07:00
Daniel Bulant
e3898bda50
Add a simple example about reading and synchronizing values from a Scroll 2024-10-16 22:41:42 +02:00
Jonathan Johnson
5b928327dc
Simplify Button color caching logic
Fixes #180
2024-10-16 12:37:21 -07:00
Jonathan Johnson
34d1cf055e
Stack/Grid exact-dimension scaling fix 2024-10-10 08:51:30 -07:00
Jonathan Johnson
a129e64d77
Fixed cursor hover events
Broken in 4f3ef7d9ed. Thanks to @pepone42
for reporting this.
2024-10-09 08:21:01 -07:00
Jonathan Johnson
b0a870aceb
CornerRadii conversion helpers 2024-10-07 13:01:03 -07:00
Jonathan Johnson
af208519eb
ImageCornerRadius
In the end I think people might be surprised by the default behavior to
clip corners, so I've opted to split this behavior into a separate
component that defaults to no corner radius.
2024-10-07 12:52:18 -07:00
Jonathan Johnson
2ed140a0fe
Updating Kludgine/Refactoring close 2024-10-07 12:52:05 -07:00
Jonathan Johnson
f96a5d2055
Unrecoverable errors as native dialogs 2024-10-07 08:06:07 -07:00
Jonathan Johnson
06c3391379
Fixing compilation with tracing disabled 2024-10-07 07:56:46 -07:00
Jonathan Johnson
223989410d
Merge pull request #174 from danbulant/image-corner-radii
Make images respect border radii
2024-10-06 12:58:19 -07:00
Daniel Bulant
8d11a900c6
Make images respect border radii 2024-10-06 20:31:02 +02:00
Jonathan Johnson
432a84be04
Scroll::preserve_max_scroll 2024-10-06 09:44:37 -07:00
Jonathan Johnson
77f1bd46f7
() -> MessageButton 2024-10-04 10:57:00 -07:00
Jonathan Johnson
43a24501f9
Save overwrite prompt in widget file picker
Refs #172
2024-10-04 10:51:43 -07:00
Jonathan Johnson
75b7b888eb
Rename pending_handle to new_handle 2024-10-04 10:20:31 -07:00
Jonathan Johnson
4f3ef7d9ed
Nested modals 2024-10-04 10:17:40 -07:00
Jonathan Johnson
0f06b22431
Merge pull request #170 from khonsulabs/dialogs
MessageBox + App::execute
2024-10-03 13:48:49 -07:00
Jonathan Johnson
a7972309c3
File picker 2024-10-03 13:39:46 -07:00
Jonathan Johnson
a73dd0f1d4
Adding notes about non-PartialEq types
Refs #171
2024-10-03 07:41:26 -07:00
Jonathan Johnson
2cec30df31
MessageBox + App::execute
Refs #131
2024-09-29 19:58:12 -07:00
Jonathan Johnson
2045d5fb4a
Allowing change callbacks to recurse still
The last fix had a panic where a guard should have been allowed to be
created. Change callbacks detect when they are about to be fired from
themselves, and prevent the deadlock.
2024-09-25 11:21:38 -07:00
Jonathan Johnson
e54bbd743d
Fixed change callback deadlock
Very hard to intentionally reproduce, thankfully the second time I saw
it I was in the debugger and was able to reason about the code path that
could have gotten in that particular state. Comment explains the actual
situation.
2024-09-25 11:13:15 -07:00
Jonathan Johnson
8561b6cf5e
Delaying resize until after render 2024-09-22 11:53:11 -07:00
Jonathan Johnson
1aa7563bd2
Updating Kludgine 2024-09-22 11:36:50 -07:00
Jonathan Johnson
7dd3a88231
Removing debug code 2024-09-22 11:11:52 -07:00
Jonathan Johnson
7639517bd3
Calling Kludgine's request_inner_size 2024-09-22 11:09:35 -07:00
Jonathan Johnson
3c12363ec4
Animate for callbacks
on_complete fires once. Callbacks can be used in a cycling animation.
2024-09-22 10:41:30 -07:00
Jonathan Johnson
3359fe0d05
SharedCallback animation 2024-09-22 10:38:46 -07:00
Jonathan Johnson
fb1888d53f
WrapperWidget::activate passthrough 2024-09-22 10:35:11 -07:00
Jonathan Johnson
e178c088c0
Logging tweaks + documentation
Closes #169
2024-09-22 07:38:20 -07:00
Jonathan Johnson
8bed71cfb5
Adding xdg to ci 2024-09-21 13:54:19 -07:00