Commit graph

128 commits

Author SHA1 Message Date
94052c5a65 Fix formatting 2024-03-04 00:08:33 +01:00
761e8baeba Bump version to 0.2.2 2024-01-14 12:38:33 +01:00
2d604d606c Fix crash when drawing Predrawn with width 0 2024-01-14 12:32:21 +01:00
b01ee297d5 Bump version to 0.2.1 2024-01-05 13:54:42 +01:00
44512f1088 Update dependencies 2024-01-05 13:53:13 +01:00
b757f1be03 Add Title widget 2024-01-05 13:52:25 +01:00
2714deeafb Add support for setting window title 2024-01-05 13:33:08 +01:00
77b4f825c9 Fix clippy warning 2024-01-05 13:23:18 +01:00
2c7888fa41 Bump version to 0.2.0 2023-08-31 13:23:00 +02:00
f6cbba5231 Update dependencies 2023-08-31 13:20:54 +02:00
87723840df Bump version to 0.1.0 2023-05-14 15:57:25 +02:00
a4ec64aa57 Update dependencies 2023-05-14 15:57:19 +02:00
6eb853e313 Reduce tearing when redrawing screen 2023-05-10 19:35:56 +02:00
3b9ffe8715 Fix full redraws always using stdout 2023-05-10 19:25:46 +02:00
f005ec10fe Fix editor panicking sometimes when hidden 2023-04-29 01:23:50 +02:00
8bfb4b2dc3 Fix Join panicking in some situations 2023-04-28 14:40:53 +02:00
f414db40d5 Add BoxedSencSync which is Send + Sync 2023-04-17 20:30:24 +02:00
968dbe501f Remove AsyncWidget impls replaceable by Desync 2023-04-17 19:46:40 +02:00
4179e7f56c Add Desync widget to turn Widgets into AsyncWidgets 2023-04-17 19:46:40 +02:00
57788a9dd9 Apply Resize's max size to available size too
I'm not sure if the input max size and the output max size should be
separate, and I'm not sure whether the min size should also have an
effect on the input. For now, this works well enough, but I may need to
adjust it in the future as I stumble across new edge cases.

This change was made because I was using Resize as a way to set the size
of widgets containing text that were rendered inside Predraw widgets.
After this change, setting a max_width but no max_height has the desired
effect of making the inner widgets perform word wrapping. The resulting
Predrawn is then as high as it needs to be to contain the wrapped text.
2023-04-17 16:48:13 +02:00
59710c8162 Fix Predrawn not drawing cursor 2023-04-17 09:38:00 +02:00
242a1aed29 Add option to stretch Padding 2023-04-14 13:57:09 +02:00
d0b3b9edd4 Fix Predrawn size calculations
Previously, Predrawn would use its parent frame's size. Now, it uses the
size requested by the widget. Because of this, it no longer requires a
full &mut Frame, but only a &mut WidthDb.

To set a maximum size, the widget can be wrapped inside a Resize.
2023-04-14 01:51:40 +02:00
810524325e Fix hidden placeholder appearing in empty editor 2023-04-13 02:18:43 +02:00
35aa70de4b Fix editor cursor 2023-04-12 19:16:29 +02:00
7c6e651f88 Add Boxed and BoxedAsync widgets 2023-04-08 16:00:04 +02:00
007493f136 Derive more traits for widgets 2023-04-08 15:40:14 +02:00
77e72de9ad Make Layer* more like Join* 2023-04-08 15:21:51 +02:00
88e66e17ec Add Predrawn widget 2023-04-06 03:00:37 +02:00
ea6be7bf32 Simplify editor cursor handling and rendering 2023-04-06 00:18:56 +02:00
542ea7bc66 Simplify Join* implementation 2023-02-26 14:57:34 +01:00
0573fcec77 Only provide WidthDb in [Async]Widget::size 2023-02-26 14:42:48 +01:00
417f33cc24 Differentiate between growing and shrinking segments
Also uses the new with_* naming scheme for segments
2023-02-20 16:57:35 +01:00
607c11fea4 Use new with_* naming scheme
All builder-like functions are now named with_*. There is also now a way
to set each property imperatively with only a mutable reference.

The only widgets I haven't yet converted to this style are the Join*
widgets; they're a bit harder to figure out an appropriate API for.
2023-02-20 15:53:49 +01:00
cb483431cc Make widget submodules public
This will make the generated documentation more readable once I add
module docstrings. I'm still reexporting the module contents to keep
imports nice and tidy.
2023-02-19 14:24:28 +01:00
397d3a6eac Add Editor widget 2023-02-19 14:18:45 +01:00
783e57a9ab Allow join segments to be fixed
I'm not sure if this is a good abstraction, or if I should instead
re-think the algorithm.
2023-02-19 02:31:58 +01:00
8f155dc6a2 Fix join widgets not handling large sizes 2023-02-19 02:09:41 +01:00
b1c276ec38 Fix panic with zero-weighted segments 2023-02-19 02:02:27 +01:00
a8876e94f3 Make default background style opaque 2023-02-18 21:24:51 +01:00
bdc1549268 Create Join[HV]{2,7} via macros 2023-02-18 20:56:36 +01:00
204540f375 Create Either{2,7} via macros 2023-02-18 20:56:10 +01:00
b27cb81642 Add Resize widget 2023-02-18 20:24:56 +01:00
ba716dd089 Fix examples not measuring widths immediately 2023-02-18 20:13:47 +01:00
3fb3a7b92b Fix sizing bug
The available space was updated while removing elements, but the check
for the next element expected the old value.
2023-02-18 19:40:33 +01:00
42d22e2a49 Fix typo 2023-02-18 19:06:22 +01:00
d449c61f27 Add JoinH2, JoinH3, JoinV2, JoinV3 2023-02-18 19:06:22 +01:00
f581fa6c47 Add JoinH and JoinV 2023-02-18 19:06:18 +01:00
828bba464a Add Either3 widget 2023-02-18 19:00:18 +01:00
15e30dfdb2 Implement join widget spacing algorithm 2023-02-18 18:20:55 +01:00