Commit graph

410 commits

Author SHA1 Message Date
Jonathan Johnson
459dc3f96a
Renaming CushyWindowBuilder to Standalone
Closes #155
2024-07-26 09:20:39 -07:00
Jonathan Johnson
48133cdac3
Fixing an edge case in computing tab order
Removing widgets would affect the visual order, and sometimes nodes just
aren't available anymore. It might be that this should be cleaned up
more aggressively during widget removal, but by ignoring the removed
nodes, the code just becomes more resilliant to similar edge cases in
the future.
2024-07-26 08:59:23 -07:00
Jonathan Johnson
ffb1475e30
Fixing padding/shadow calculations on Container
Fixes #158
2024-07-26 08:58:59 -07:00
Jonathan Johnson
ba3a4b9b02
Added Zoom factor
Closes #146
2024-07-25 11:31:38 -07:00
Jonathan Johnson
83fe4b05ef
Switching to released Kludgine 2024-07-22 08:31:11 -07:00
Jonathan Johnson
3de9d0597f
Updating kludgine and figures 2024-07-22 08:06:03 -07:00
Jonathan Johnson
66b37bb88d
Updated msrv from wgpu update 2024-07-22 07:29:10 -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
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
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
6a1f7f5462
Fixed deadlock with DynamicMutexGuard::unlocked
During the change callback process, unlocked is called to allow the
change callbacks to run while the dynamic is unlocked. The error with
the previous version of this code is that the during_callback_state was
always overwritten when being returned. The problem is that another
thread could currently have the mutex locked and could have stored its
own state -- which can happen if two threads are both trying to invoke
change callbacks at the same time.

By moving the state saving and reloading to only happen when the mutex
guard is acquired, we can ensure that interleaving threads will work
correctly.
2024-06-13 09:16:13 -07:00
Jonathan Johnson
f61cb2b91b
Fixing deadlock in debug window cleanup 2024-06-07 11:01:53 -07:00
Jonathan Johnson
a6d5b078f5
Added ForEach::for_each_subsequent
Refs #153

This turned out to be "needed" by the debug window due to how dynamic
locking was nested when a for_each call was being invoked. To keep the
code simple, for_each_subsequent was added.
2024-06-07 10:27:07 -07:00
Jonathan Johnson
7bd13e2a0a
Added for_each_subsequent
Refs #156

The ForEach trait currently doesn't have a subsequent version, but given
the discussion in the related issue I think that's OK.
2024-06-07 09:08:14 -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
3da08bca62
Fixed a crash in Switcher
I'm not sure exactly what caused this that other simpler cases were not,
but essentially nodes were already removed once by the time this loop is
evaluated, so we can skip adding them back to the list again.
2024-05-13 08:39:43 -07:00
Jonathan Johnson
774a846210
animate_mouse_button + more example recordings 2024-05-12 19:12:01 -07:00
Jonathan Johnson
d234e6e607
Enabling all features when generating example images 2024-05-12 14:44:51 -07:00
Jonathan Johnson
568f2ca327
Added plotters example capture + animate_keypress 2024-05-12 14:23:29 -07:00
Jonathan Johnson
cf78c9defa
Updating cushy-macros
(And really releasing v0.3.0)
2024-05-12 08:52:19 -07:00
Jonathan Johnson
2917430d94
Fixing image references to guide 2024-05-12 08:37:24 -07:00
Jonathan Johnson
c566bc2fcf
Fixing guide-examples reference to Cushy 2024-05-12 08:35:14 -07:00
Jonathan Johnson
db2296c626
Preparing v0.3.0 2024-05-12 08:30:43 -07:00
Jonathan Johnson
daccac26bb
Adding theme editor screenshot to readme 2024-05-12 08:12:24 -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
be7145a43f
Guide readme + cleaning repo 2024-05-12 07:20:52 -07:00
Jonathan Johnson
ad19981704
Adding x11 deps for example regeneration 2024-05-12 07:05:27 -07:00
Jonathan Johnson
997cc9586f
Simplifying drop shadow
Also making example regeneration automatic in CI for the guide
2024-05-12 06:57:41 -07:00
Jonathan Johnson
a3903463ea
Added note in changelog for appit fix 2024-05-12 06:45:27 -07:00
Jonathan Johnson
b57188f80f
Added optional tokio integration
Closes #147
2024-05-11 21:25:54 -07:00
Jonathan Johnson
8f5ce94a87
Making screenshot link to guide 2024-05-11 19:42:50 -07:00
Jonathan Johnson
9a987532d5
Adding "screenshot" to readme 2024-05-11 19:41:49 -07:00
Jonathan Johnson
7f55b352b4
Export Menu + Finish Guide Stubs 2024-05-11 19:30:36 -07:00
Jonathan Johnson
ddacd53084
More guide stubbing 2024-05-11 18:11:24 -07:00
Jonathan Johnson
07f1febe9f
Removed ChosenMenuItem
Also updated the changelog
2024-05-10 12:15:33 -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
ecf0d45bfa
Updating MSRV 2024-05-02 07:07:13 -07:00
Jonathan Johnson
da6440a9a6
Updated changelog 2024-05-01 12:49:30 -07:00
Jonathan Johnson
46c4eb9ed8
winit 0.30 2024-05-01 12:49:03 -07:00
Jonathan Johnson
8880fece3a
Updated kludgine 2024-05-01 08:52:53 -07:00
Jonathan Johnson
5e266f1551
Optimizing label text recaching
I had previously had similar logic in here, but I realized I couldn't
reliably detect if cosmic_text had done any wrapping or not. After a
discussion prompted me to see if recaching was happening while
scrolling, I realized I could at least allow the width to be >= the
measured text size and <= the requested layout width.

This prevents recaching while scrolling.
2024-04-07 14:33:50 -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
44759d4812
Fix when replacing an overlay
When an overlay handle dropped directly after pushing a new overlay, it
was possible for new overlays to be popped off improperly, causing a
subtraction overflow panic later.
2024-03-21 11:26:34 -07:00