Commit graph

12 commits

Author SHA1 Message Date
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
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
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
6726855ed0
Cleaning up figures usage in examples 2024-07-26 10:34:30 -07: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
2fe28729df
Directly depending on figures
While this was a workaround for a docs.rs issue (Px/Lp are not
linked), I decided having the shorter import path would look better in
the examples.

It probably wasn't necessary to update all of the references in the
internal code, but I decided it was worth the consistency.
2023-12-28 09:35:24 -08:00
Jonathan Johnson
df479e983e
Renaming crate to Cushy
Refs #117
2023-12-27 19:02:59 -08:00
Jonathan Johnson
f1a2a711ff
Multi-window support
Closes #91

There's some details to still figure out, which are in new issues:

- #109: When opening a window, no handle is returned that gives access to the
  window from the opener. Technically this can all be wired up manually,
  with exception of requeesting the window close.
- #107: How can a window close itself? Once we have a handle type, we still
  need a mechanism to allow a button on a window request that the window
  closes gracefully. The examples that currently close the window
  call exit instad.
2023-12-21 14:57:29 -08:00
Marli Frost
f9d0203ff5 Add API for tracking checked to the inner_size of a window
This matched the apis used for focused and occluded
properties. I've added an example to demonstrate usage.
2023-12-19 13:51:28 +00:00