Commit graph

196 commits

Author SHA1 Message Date
Jonathan Johnson
96a265854b
Label overflow + Virtual list horizontal scrolling 2024-11-08 10:12:28 -08:00
Jonathan Johnson
1bb5495f53
Added content refresh for virtual list
Also expanded interactive example to have a slider for item count and a
refresh button.
2024-11-08 09:01:59 -08:00
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
Daniel Bulant
1705a7f46c
rename scroll example 2024-10-25 22:11:26 +02: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
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
ab474e2b7d
Fixing example references to dependencies
Ensuring all examples use public paths to make copy/paste more likely to
be successful.
2024-10-10 09:06:43 -07:00
Daniel Bulant
899037d543
add filtermode to image example 2024-10-09 21:59:14 +02: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
a7972309c3
File picker 2024-10-03 13:39:46 -07:00
Jonathan Johnson
2cec30df31
MessageBox + App::execute
Refs #131
2024-09-29 19:58:12 -07:00
Jonathan Johnson
20ab1ad029
Fixed initial window settings
These aren't entries in the changelog since they're bug fixes for new
code since the last release -- the entries on the changelog are
unaffected.

- focused and occluded no longer is explicitly set to false. Now, once
  the window has been fully initialized, the values are read from winit
  which will cause callbacks to be fired if the value has changed.
- The automatic_layout parameter if outer_position had its meaning
  inverted. Passing true now properly ensures the window is
  automatically positioned.
2024-09-13 10:12:01 -07:00
Jonathan Johnson
444fbbe4ed
Modal DialogBuilder 2024-09-12 14:49:37 -07:00
Jonathan Johnson
8d082ab77f
Modal layer 2024-09-11 20:54:08 -07:00
Jonathan Johnson
448482e7bf
Fullscreen example 2024-09-09 08:12:59 -07:00
Jonathan Johnson
dd4c544ba6
Window sync edge cases
- synchronize_platform_window is now called prior to the first redraw.
  This allows the `visible` attribute to be changed from false to true.
- Some window attributes are automatically set based on the incoming
  dynamic.
- Some initial window values are delayed until after the first layout to
  minimze "noisy" values.

All of these changes now allow a window that is resize_to_fit to be
initially hidden and show itself centered after being initially resized
without any flashing or on-screen movement/resizing.
2024-09-08 11:29:29 -07:00
Jonathan Johnson
bbbc8151c4
cushy::main attribute macro 2024-09-08 09:31:35 -07:00
Jonathan Johnson
0953e5ab40
Window::icon 2024-09-07 10:13:48 -07:00
Jonathan Johnson
531e6c9ab6
Window positioning properties
Closes #165
2024-09-07 09:31:40 -07:00
Jonathan Johnson
bf78da333d
App::monitors + run()/on_startup()
Closes #163
2024-09-06 11:50:35 -07:00
Jonathan Johnson
0dd18826c9
Switcher unmounts in all windows
Fixes #139
2024-08-28 08:49:26 -07:00
Jonathan Johnson
7bd79b0662
Switched to released easing-function
Also added new easings example.
2024-08-18 10:58:44 -07:00
Jonathan Johnson
18d14a0275
Fixing example test compilation issues 2024-08-18 08:01:00 -07:00
Jonathan Johnson
df748a991d
Extracting easing functions + Clippy 2024-08-17 17:44:12 -07:00
Jonathan Johnson
6726855ed0
Cleaning up figures usage in examples 2024-07-26 10:34:30 -07:00
Jonathan Johnson
ba3a4b9b02
Added Zoom factor
Closes #146
2024-07-25 11:31:38 -07:00
Jonathan Johnson
fbabbdbd99
Reverting example change
Was an unrelated test, oops.
2024-07-08 17:07:00 -07:00
Jonathan Johnson
60c7ef8859
Honoring Window::inner_size's initial value
Refs #160
2024-07-08 16:50:50 -07:00
Jonathan Johnson
24291772de
Added Window::on_close_requested
Closes #161
2024-07-08 16:06:45 -07:00
Jonathan Johnson
774a846210
animate_mouse_button + more example recordings 2024-05-12 19:12:01 -07:00
Jonathan Johnson
568f2ca327
Added plotters example capture + animate_keypress 2024-05-12 14:23:29 -07:00
Jonathan Johnson
15b8b3e452
Moved example generation into cushy
Undocumented and unsupported, but this allows generating example images.

This push is testing that the image makes it through CI.

Refs #125
2024-05-12 07:58:09 -07:00
Jonathan Johnson
b57188f80f
Added optional tokio integration
Closes #147
2024-05-11 21:25:54 -07:00
Jonathan Johnson
c5f1832b3e
Disabled menu item support 2024-05-10 10:16:47 -07:00
Jonathan Johnson
b8410cd4ba
Separators in menus 2024-05-10 09:51:02 -07:00
Jonathan Johnson
38cdea9816
Submenu support in context menus 2024-05-10 09:10:39 -07:00
Jonathan Johnson
8b96966031
Basic context menus
Missing a ton of functionality (separators, keyboard accessibility,
submenus), but the basic concept is working.
2024-05-09 08:16:34 -07:00
Jonathan Johnson
1c8d4e0176
ButtonClick + Overlays at locations
The overlay example now supports right-clicking to open overlays at the
clicked location, showing how a context menu widget can begin being
built.
2024-05-08 08:38:26 -07:00
Jonathan Johnson
46c4eb9ed8
winit 0.30 2024-05-01 12:49:03 -07:00
Jonathan Johnson
20ae2b7c72
map_each deadlock prevention
map_each previously was written such that if a chain of mappings fed
each other, a deadlock could occur because while the first one was
mapped, the second callback gets invoked and tries to update the first
value while it's still being held.

This refactor switches from std Mutex to parking_lot, allowing me to
remove a workaround for needing to run drop callbacks in a separate
thread during the drop of a DynamicGuard.

In addition to that change, the lower level `map_generational` calls now
take a DynamicGuard as their parameter. This allows these functions to
drop ownership of the referenced data during the callback.

The map_each implementation takes advantage of this by ensuring that the
guard is dropped before set is invoked, minimizing potential lock overlaps.

With this refactor, some old code of mine with complex validations now works
again.
2024-04-05 16:14:26 -07:00
Jonathan Johnson
3762bc6dc1
Dynamic font loading
Closes #145
2024-03-06 16:53:36 -08:00
Jonathan Johnson
0e02a513bb
Updating dependencies
This makes the lockfile build against the new release of wgpu.
2024-03-06 09:21:43 -08:00
Jonathan Johnson
e2e5085b1f
Added List widget 2024-01-18 13:29:50 -08:00
Jonathan Johnson
76a42e2788
Updated to wgpu 0.19.0
Most of the changes were figures-related. Go figure.
2024-01-18 06:37:29 -08:00
Jonathan Johnson
cc207fbf8c
Added optional plotters integration
Closes #133

The real work was done in Kludgine.
2024-01-11 20:52:40 -08:00