Commit graph

154 commits

Author SHA1 Message Date
Jonathan Johnson
2ed140a0fe
Updating Kludgine/Refactoring close 2024-10-07 12:52:05 -07:00
Jonathan Johnson
4f3ef7d9ed
Nested modals 2024-10-04 10:17:40 -07:00
Jonathan Johnson
2cec30df31
MessageBox + App::execute
Refs #131
2024-09-29 19:58:12 -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
fb1888d53f
WrapperWidget::activate passthrough 2024-09-22 10:35:11 -07:00
Jonathan Johnson
8bed71cfb5
Adding xdg to ci 2024-09-21 13:54:19 -07:00
Jonathan Johnson
01b764de0b
File drop events 2024-09-16 09:15:29 -07:00
Jonathan Johnson
e7ccbac18c
Support immediately resizing without refreshing
On some platforms, notably Wayland, the window immediately responds to
resize requests. This means that if the window resizes itself during the
prepare operation, the current graphics context is no longer the correct
size for the window. Before this change, Kludgine was working around
this by noticing the discrepency and forcing an extra refresh. This
workaround is still in place in Kludgine, but now Cushy supports
restarting redrawing upon resize.
2024-09-16 08:22:30 -07:00
Jonathan Johnson
b4058fc55b
Honoring request_inner_size results 2024-09-16 07:04:36 -07:00
Jonathan Johnson
229bbd4913
Window::on_init 2024-09-14 10:33:42 -07:00
Jonathan Johnson
5f832c304f
Window shortcuts
Due to complexities in input routing and how that interacts with layers,
it seemed prudent to support installing shortcuts directly on the
window.

This also enables overriding default shortcuts like Primary+W to close
the window.
2024-09-13 16:18:30 -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
71f699ccda
WindowHandle::execute 2024-09-11 16:29:04 -07:00
Jonathan Johnson
8eaf0f414f
serde feature 2024-09-11 06:19:35 -07:00
Jonathan Johnson
aa7e526965
Standardizing on SharedCallback 2024-09-09 16:37:04 -07:00
Jonathan Johnson
0f866009b8
app_name, fullscreen, focused
Finally finished removing WindowAttributes.
2024-09-09 07:49:21 -07:00
Jonathan Johnson
8d653c2d6c
Modifiers support
Closes #162
2024-09-09 06:49:04 -07:00
Jonathan Johnson
1cb93e2af2
Moving non-generic code to its own function. 2024-09-08 13:29:44 -07:00
Jonathan Johnson
14d2069fec
MakeWindow + easy window centering 2024-09-08 13:19:55 -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
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
634a4b7af8
Added most window settings from winit
Refs #160
2024-09-05 20:31:01 -07:00
Jonathan Johnson
9304165981
PendingWindow in PendingApp fix + resize_to_fit 2024-09-04 08:29:13 -07:00
Jonathan Johnson
0dd18826c9
Switcher unmounts in all windows
Fixes #139
2024-08-28 08:49:26 -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
459dc3f96a
Renaming CushyWindowBuilder to Standalone
Closes #155
2024-07-26 09:20:39 -07:00
Jonathan Johnson
ba3a4b9b02
Added Zoom factor
Closes #146
2024-07-25 11:31:38 -07:00
Jonathan Johnson
553c4ab959
Updating Kludgine for wgpu
The dependence on git is just to let CI run before releasing a kludgine
update with wgpu 22.0.0 support.
2024-07-22 07:19:58 -07:00
Jonathan Johnson
60c7ef8859
Honoring Window::inner_size's initial value
Refs #160
2024-07-08 16:50:50 -07:00
Jonathan Johnson
4d6196f4e7
Fixing default for no close-requested handler 2024-07-08 16:22:15 -07:00
Jonathan Johnson
24291772de
Added Window::on_close_requested
Closes #161
2024-07-08 16:06:45 -07:00
Jonathan Johnson
8c8dca63ba
Clarified some window builder documentation
Really the functions should be renamed -- see #155
2024-05-17 15:00:24 -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
b57188f80f
Added optional tokio integration
Closes #147
2024-05-11 21:25:54 -07:00
Jonathan Johnson
38cdea9816
Submenu support in context menus 2024-05-10 09:10:39 -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
beede55f0a
Added winit accessor
I originally removed this API to ensure no Cushy widgets were using
winit directly, but I've reintroduced it so that third party widgets can
still interact with winit if needed.
2024-04-03 09:13:36 -07:00
Jonathan Johnson
173fb2d540
Allowing changing multisampling on all windows 2024-03-21 09:02:07 -07:00
Jonathan Johnson
18abfc66f2
Added ability to disable vsync 2024-03-17 08:44:02 -07:00
Jonathan Johnson
3762bc6dc1
Dynamic font loading
Closes #145
2024-03-06 16:53:36 -08:00
Jonathan Johnson
0e5976de10
Dynamic::try_lock
Plus other minor changes.
2024-01-26 18:13:42 -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