Commit graph

326 commits

Author SHA1 Message Date
Jonathan Johnson
6958c6863c
Fixing Color::contrast_between
While working on the color pickers, I was noticing the contrast_between
choices seem a little off.
2024-01-11 07:09:17 -08:00
Jonathan Johnson
8a274df730
Added more color pickers
This set of changes is making me think of adding Rgb/Rgba types and
having our own color enum.
2024-01-10 13:27:12 -08:00
Jonathan Johnson
246352fed2
Added HslPicker 2024-01-10 08:17:09 -08:00
Jonathan Johnson
6ad6cca32d
Children renamed to WidgetList
Plus more work on the user's guide, which inspired the rename.
2024-01-09 13:26:14 -08:00
Jonathan Johnson
b5bd69136a
Linking to user guide 2024-01-09 07:08:15 -08:00
Jonathan Johnson
93775bc542
Moved guide "warning" to all pages
This required overriding the main theme file to position it where I
wanted it to be. head.hbs puts it above the button bar, and header.hbs
puts it outside the page area entirely.
2024-01-09 06:53:18 -08:00
Jonathan Johnson
7be9894404
Trying to make Mac CI fail gracefully
This message may be repeated multiple times as I work on the CI
configuration.
2024-01-08 09:41:04 -08:00
Jonathan Johnson
7500a6b20f
Trying to make Mac CI fail gracefully
This message may be repeated multiple times as I work on the CI
configuration.
2024-01-08 09:20:10 -08:00
Jonathan Johnson
97ab3cd1a3
Trying to make Mac CI fail gracefully
This message may be repeated multiple times as I work on the CI
configuration.
2024-01-08 09:18:53 -08:00
Jonathan Johnson
d7fde0815f
Trying to make Mac CI fail gracefully
This message may be repeated multiple times as I work on the CI
configuration.

Refs #129
2024-01-08 09:17:03 -08:00
Jonathan Johnson
5556d2ea6d
FlexibleDimension now implements Zero 2024-01-08 09:07:17 -08:00
Jonathan Johnson
adb51dba7e
More user guide work 2024-01-07 15:57:23 -08:00
Jonathan Johnson
01d6da3d35
Added layout widget descriptions 2024-01-07 11:49:39 -08:00
Jonathan Johnson
b82208887d
Standardizing durations
I didn't notice I had settled on 1 second for all three stages in
the end lol.
2024-01-06 15:05:11 -08:00
Jonathan Johnson
8c3eaf4b6b
Fixing MSRV
I had forgotten why I had `self::image::Image` and it was causing the
docs to show up out of order. This now makes them all consisent, fixing
the docs issue.
2024-01-06 14:57:59 -08:00
Jonathan Johnson
882ec6f4aa
Fixing warnings + missing docs 2024-01-06 14:57:46 -08:00
Jonathan Johnson
e548f1255d
Closing no longer repeats
Closes #108

Turns out there was a property on KeyEvent this whole time... oops.
2024-01-06 14:55:49 -08:00
Jonathan Johnson
cda13c42a2
Guide intro + KeyEvent
Also fixed virtual window's refresh handling.
2024-01-06 14:46:48 -08:00
Jonathan Johnson
31de0bc458
Fixing asset link
And a little more filler
2024-01-06 11:01:56 -08:00
Jonathan Johnson
8fb372e743
Work on guide 2024-01-06 10:26:23 -08:00
Jonathan Johnson
bb28f96b58
Space fix 2024-01-06 10:25:45 -08:00
Jonathan Johnson
1b608b39af
Removing direct winit access
This was a holdover while I was still implementing the PlatformWindow
interface. Cushy widgets shouldn't be able to access winit directly,
otherwise they could cause unwanted effects when not running in a
standalone Cushy app but rather embedded in a game.
2024-01-05 18:17:44 -08:00
Jonathan Johnson
a3e76f6472
Calling set_ime_cursor_location
Currently passing the entire input area because it's easy. Not closing
the issue because the correct thing to do would be to constrain the
location to a smaller area on the current line (or the current line).

Refs #122
2024-01-04 17:08:05 -08:00
Jonathan Johnson
4dc5cb5cc4
Merge pull request #123 from khonsulabs/offscreen
Initial implementation of offscreen rendering
2024-01-04 16:10:33 -08:00
Jonathan Johnson
5a78788396
Enabling animated transparent capture 2024-01-04 16:09:58 -08:00
Jonathan Johnson
6ff766846f
Added CushyWindow
While working on the changelog, I realized I didn't provide a type that
allowed a third party developer to provide a
PlatformWindowImplementation. This type now completes it.
2024-01-04 15:58:29 -08:00
Jonathan Johnson
a197bb5e81
Unit-tested, auto-generated screenshots
This commit adds my first take at creating a harness for a user's guide
using the new capture functionality. The example has tests that ensure
the align widget creates the expected results.
2024-01-04 13:56:45 -08:00
Jonathan Johnson
eb20133116
Reinstating weak_clone and non-weak callbacks
Somehow I missed that my changes for weak callbacks broke the theme
editor. I thought I had it working with the try_get changes, but I
discovered several flaws in this approach.

In the end, ownership has been transferred to the CallbackHandle, and a
CallbackHandle can relinquish its reference to create weak graphs. This
is how weak_clone now works.
2024-01-04 13:56:26 -08:00
Jonathan Johnson
36b80e8f34
Moved frame mapping to its own thread
This ensures frames render consistently.

This change only affects the animation recorder. The regular virtual
recorder interface blocks when refresh is called.
2024-01-03 20:15:00 -08:00
Jonathan Johnson
bc52be440f
Added animation recording + event wiring
Not great, but it technically exists.
2024-01-03 17:45:11 -08:00
Jonathan Johnson
2e2d45d281
Switching wgpu dependencies
This now matches the current CI config on wgpu's repository.
2024-01-03 12:24:22 -08:00
Jonathan Johnson
5a56833cd0
Switching text matrix to continue jobs 2024-01-03 11:44:15 -08:00
Jonathan Johnson
cdef6bcbc3
Removed unnecessary bytemuck usage
This was copy-pasted from a Buffer<T> implementation that was removed
from Kludgine, since Buffer<T> isn't public.
2024-01-03 11:41:26 -08:00
Jonathan Johnson
be0399279c
Initial implementation of offscreen rendering 2024-01-03 11:35:43 -08:00
Jonathan Johnson
244797110e
Added to_ variants for into_ functions 2024-01-02 15:07:06 -08:00
Jonathan Johnson
8bcbad959b
Regenerating readmes 2024-01-02 14:40:41 -08:00
Jonathan Johnson
83e44912ee
ReadOnly<T>, Owned<T>, IntoSource<T>, more
Closes #98

This finishes my initial refactoring of the dynamic system to add
support for several dataflows including:

- Pure data sources that can be implemented using an `Owned<T>` at the
  root of a graph of `Dynamic<U>`/`DynamicReader<U>`s.
- Read-only data sinks. I thought this would be more useful across other
  widgets, but in general, Progress and Label seem like the only types
  that this applies to currently.
- The ability to mix/match Dynamic/DynamicReader in tuple-based
  for_each/map_each.
2024-01-02 14:36:53 -08:00
Jonathan Johnson
8b19c4c304
Fixing doctests 2024-01-02 09:18:18 -08:00
Jonathan Johnson
276ba97bf7
Actually clamping on f32 div
For some reason I forgot about 1.0 being an edge case, but I also didn't
think about negatives either. Applying a clamp is the right move here.

Refs #120
2024-01-02 09:16:21 -08:00
Jonathan Johnson
e70e92726c
Source<T> + Destination<T> (breaking)
Refs #98

This refactor overhauls the reactive system to move all the reactive
methods to traits. The side effect of this change is that now
DynamicReader's API is the same as Dynamic's API, but because it only
implements Source<T>, DynamicReader does not offer any mutation
functions.

While it's unfortunate to have more traits to include to use Cushy, this
seems like the best option, and it offers a path to try to integrate
this into the tuple ForEach/MapEach traits. Unfortunately, my attempt at
doing those in this set of changes led to issues specifying generic
associated lifetimes for the DynamicGuard. But, I was also in the middle
of this larger refactoring, so it might be that a fresh attempt will
succeed.
2024-01-02 09:00:29 -08:00
Jonathan Johnson
c1d6e3f7fd
Fixed Switcher widget
This was broken in unreleased changes, hence no changelog update.
2024-01-02 08:37:10 -08:00
Jonathan Johnson
36d4239df5
CI: Working on CI
(This message may be repeated while I debug github actions errors)
2024-01-01 13:45:53 -08:00
Jonathan Johnson
9786852bf6
Ci: Trying alternate way to pass version 2024-01-01 13:44:43 -08:00
Jonathan Johnson
f0e1118719
Switching test CI to a matrix
Also adding Mac
2024-01-01 13:39:48 -08:00
Jonathan Johnson
aa790d0411
Disambiguating image reference
When building tests, dev-dependencies include image which apparently is
ambiguous in 1.70.0.
2024-01-01 13:04:51 -08:00
Jonathan Johnson
912d5566bc
Attempting to add Windows CI 2024-01-01 13:00:55 -08:00
Jonathan Johnson
4d94bccfa6
Restoring MSRV 1.70.0
Fixes #120
2024-01-01 12:55:18 -08:00
Jonathan Johnson
f56e8b7e29
Adding MSRV CI job 2024-01-01 12:48:48 -08:00
Jonathan Johnson
a9a41a1582
Refactored Dymamics to be weak + drop bug fixes
After adding weak_clone, I realized that all map functions should use
weak references anyways. In the process of implementing this, I ran
tests a lot and found other edge cases where I hadn't properly reasoned
about Drop behavior.

While some of the state cleanup is a bit overkill at the moment, this is
in anticipation of wanting a WeakDynamicReader-like type.
2024-01-01 12:35:21 -08:00
Jonathan Johnson
e4dfd9320d
Fixed a possible deadlock in block_until_updated
The animation doctest randomly failed on me this morning, and I isolated
it to the order of the two mutexes. There's no reason to hold the
deadlock mutex for more than the check for deadlock, so I switched which
mutex the condvar is synchronizing using to ensure that another thread
couldn't cause a deadlock by dropping a DynamicMutexGuard while the
block_until_updated thread is performing its state check.
2023-12-31 10:21:45 -08:00