Commit graph

250 commits

Author SHA1 Message Date
Jonathan Johnson
cb65b014a3
Updated docs url 2023-12-25 07:59:40 -08:00
Jonathan Johnson
e813f168f8
Switching to Dossier for docs 2023-12-25 07:43:54 -08:00
Jonathan Johnson
443c5b40d1
Fix: Click selection across merged glpyhs
Closes #112
2023-12-24 16:57:53 -08:00
Jonathan Johnson
470267ccfe
Input selection constraining
Closes #113
2023-12-24 08:26:09 -08:00
Jonathan Johnson
8d3a4a42cf
Updating Kludgine
This fixes a few issues, the most important being a crash when a window
is minimized
2023-12-22 12:18:04 -08:00
Jonathan Johnson
6b33b0f686
Fixed reference cyle in ManagedWidget 2023-12-22 09:51:06 -08:00
Jonathan Johnson
564b9e5a96
Added comments to multi-window
Also made it open a second window before startup
2023-12-21 15:41:34 -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
Jonathan Johnson
4c9e2d5989
Dynamic::compare_swap + Validations now block
This sounds like a regression, but it was masking a "race condition".
DynamicGuard runs the change callbacks on drop in a background thread.
Validations was using the guard to not have to lock twice.

This led to an issue where the invalid count might be non-zero due to
the callbacks not being invoked, preventing the closure from being
invoked even though there are no validation errors.

Introducing compare_swap gives a higher-level API for Validations to
use, and it also ensures the callbacks are able to be run in the current
thread.
2023-12-21 09:12:24 -08:00
Jonathan Johnson
32cd07c241
Validations::validate_result 2023-12-21 08:32:01 -08:00
Jonathan Johnson
641ae3a17d
Debug for WeakDynamic 2023-12-21 07:11:24 -08:00
Jonathan Johnson
2ad583926b
Disabled automatic window growing
Closes #92
2023-12-20 11:41:31 -08:00
Jonathan Johnson
4e145d7f35
Removed UnwindSafe bounds
appit wasn't supposed to pass along this requirement
2023-12-20 11:35:19 -08:00
Jonathan Johnson
2575deecf8
Removed TODOs that are now issues 2023-12-20 11:03:48 -08:00
Jonathan Johnson
9aaf22c903
Preparing v0.1.3 2023-12-19 16:45:51 -08:00
Jonathan Johnson
c0620839c4
Updating changelog 2023-12-19 16:42:53 -08:00
Jonathan Johnson
25d1caa1ea
Added background-tasks example 2023-12-19 16:23:07 -08:00
Jonathan Johnson
27d5594776
Fixed odd padding rounding issues
The Container code was causing small rounding errors when laying out
that would cause the layout to sometimes me larger by a pixel. I
searched for all locations we are applying padding and added rounding
calls.

Refs #92
2023-12-19 15:20:02 -08:00
Jonathan Johnson
c117b1527e
Fixed integer overflow in Grid
When no space is available for the first gutter when fractional widths
are being used, there was a non-saturating subtraction that could
underflow.
2023-12-19 15:07:07 -08:00
Jonathan Johnson
a79d2f7d58
Updated Kludgine 2023-12-19 14:55:06 -08:00
Jonathan Johnson
ecca658375
Merge branch 'reactive-inner-size' 2023-12-19 14:20:18 -08:00
Jonathan Johnson
873e6d6f16
Added inner_size syncing
This adds upon the work in #94 by allowing the dynamic's value to be set
and it cause the window size to change.

I've ordered the resizing operations so that changes to the property are
prioritized over automatic adjustments. This doesn't change the behavior
for automatic adjustments in any way.
2023-12-19 13:33:45 -08:00
Jonathan Johnson
4959296e07
Fixed callback invocation from multiple threads
Closes #97

There was a potential race condition described in #97 that I realized I
had seen occasionally when interacting with an element that was
currently being animated. These were in complex situations, so I thought
I had a situation that could have legitimately caused the warning.

However, this warning is preventing a very specific coding "error", and
that program did not have it. The existing implementation would
potentially prevent one thread's change from invoking its callbacks
because another thread was already executing its callbacks.

This change moves that state into a Mutex/Condvar pair that allows
detecting reentry while allowing other threads to block until its their
turn. When it becomes their turn, they can check whether the callbacks
were invoked with the current value or not to prevent callbacks from
being invoked in quick succeession with the same value by multiple
threads.
2023-12-19 11:41:21 -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
Jonathan Johnson
63fd92eea6
Added changelog 2023-12-18 20:14:01 -08:00
Jonathan Johnson
75eb96b5f5
Preparing v0.1.2 2023-12-18 17:15:21 -08:00
Jonathan Johnson
a1e3082527
Fixing compilation on Windows
Condvar isn't UnwindSafe on Windows either. See
rust-lang/rust#118009
2023-12-18 17:10:04 -08:00
Jonathan Johnson
7dc00f27e0
Fixing links in readme
I somehow lost my variables at some point.
2023-12-18 11:40:45 -08:00
Jonathan Johnson
5be40e7271
Preparing gooey-macros for publish 2023-12-18 11:25:38 -08:00
Jonathan Johnson
62ad57b17f
Updating to released kludgine/figures/appit 2023-12-18 11:18:43 -08:00
Jonathan Johnson
309dad95b3
Moving readme changes to the right location 2023-12-18 10:00:53 -08:00
Jonathan Johnson
4a68fa08f8
Updated README and Cargo.toml
Also removed example that wasn't ever completed.
2023-12-18 09:56:37 -08:00
Jonathan Johnson
02d6b343f1
Widget docs + refactoring
- MakeWidgetWithId::make_with_id -> MakeWidgetWithTag::make_With_tag
- ManagedWidget -> MountedWidget
- *_refresh -> *_redraw, standardized on terminology
- get_tracked -> get_tracking_redraw
2023-12-17 07:38:31 -08:00
Jonathan Johnson
01e04a4eb9
Improving the readmes a bit 2023-12-15 14:31:44 -08:00
Jonathan Johnson
7ae4374411
ColorSource picker 2023-12-15 14:01:31 -08:00
Jonathan Johnson
2b46b0b34c
Fixing scrollbar showing/hiding + hit detection 2023-12-15 14:00:31 -08:00
Jonathan Johnson
10d3ef401f
Updating Kludgine 2023-12-15 14:00:19 -08:00
Jonathan Johnson
b4caa38b83
Fixing grid gutter calculations
The space for fractional children's gutters was being doubled.
2023-12-15 13:59:09 -08:00
Jonathan Johnson
d7d06e41fa
Fixing various mouse selection bugs
Realized that I was skipping invisible glyphs during construction of
MeasuredText. Once those were in, most of the issues vanished. A few
small tweaks and now it works surprisingly well.
2023-12-14 19:59:27 -08:00
Jonathan Johnson
d7d0d6eb56
Squashed some todos 2023-12-14 17:30:40 -08:00
Jonathan Johnson
eb91e73a6e
Scrollbars are now clickable 2023-12-14 16:55:02 -08:00
Jonathan Johnson
0fd7c8fd5c
Implemented Wrap
Closes #59
2023-12-14 10:48:35 -08:00
Jonathan Johnson
c4200e6009
Added MountedChildren 2023-12-14 07:48:56 -08:00
Jonathan Johnson
aa996a090b
Tooltips
Closes #37
2023-12-13 16:30:34 -08:00
Jonathan Johnson
cd4bb5130f
Widget::full_control_redraw
+ transparent containers show their shadows properly
2023-12-13 14:45:56 -08:00
Jonathan Johnson
353db9dc39
Added Opacity component
Closes #87
2023-12-13 14:02:39 -08:00
Jonathan Johnson
1ea9938198
Fixing style inheritance 2023-12-13 12:51:43 -08:00
Jonathan Johnson
0adb43a234
Implemented local styles
Closes #86
2023-12-13 10:44:34 -08:00
Jonathan Johnson
b1177e7c25
Gutter is now a property on Stack 2023-12-13 09:38:12 -08:00
Jonathan Johnson
5c720e6009
Align + Overlay + Shadow fixes
- Blur no longer expands the shadow geometry, but instead is clamped to
  avoid overlapping drawing calls.
- Overlay now handles hit tests correctly with regards to the original
  relative widget.
- Align was using an Into conversion that wasn't actually correct,
  causing the contents to not actually get aligned in some situations.
2023-12-13 08:26:09 -08:00