Commit Graph

6 Commits

Author SHA1 Message Date
Olivier FAURE 60c037dc1f
Add arbitrary properties to widgets (#873)
Add `Properties[Mut]` argument to widget methods.
Add a third TreeArena to sort per-widget arbitrary property values.

For the type-to-value map, I considered the following crates:
- https://docs.rs/typemap/latest/typemap/
- https://crates.io/crates/typemap_rev
- https://crates.io/crates/typemap-ors
- https://github.com/chris-morgan/anymap
- https://github.com/reivilibre/anymap3

Of these, anymap3 is the only one actively maintained (last commit less
than 12 months ago). The code source itself is extremely light and
simple; we may or may not decide to roll out our own implementation down
the line.

Add a BackgroundBrush property used by SizedBox as a proof of concept.

Note that SizedBox still has its `background` field, but we should
expect future widgets to use almost *exclusively* properties; properties
usually shouldn't be redundant with local fields.

To get there, we'll first need to better integrate properties in Xilem.
2025-03-06 11:32:06 +00:00
Olivier FAURE d77b31b892
Reorganize Masonry modules (#848) 2025-01-24 11:24:31 +00:00
Olivier FAURE d49b06a8e2
Make pointer events affect focus (#822)
Clear the focus when user clicks outside of the focused widget
Add `most_recently_clicked_widget` value, so that clicking influences
which widget will be focused by future Tab events.
2025-01-14 17:10:26 +00:00
Olivier FAURE 51a355615f
Document most items in Masonry (#815)
Move `#[allow(missing_docs)]` to two modules. Missing docs now warn
everywhere else by default.

Remove `#[expect(rustdoc::broken_intra_doc_links)]` and fix all broken
links.
2025-01-13 17:36:31 +00:00
Kaur Kuut 419f8f115e
Match CI doc testing with docs.rs. (#726)
* Treat doc warnings as errors. Historically we've not done so due to
various `rustdoc` bugs giving false positives but I got it to pass
without failure right now, so perhaps better times have arrived.
* Target only `x86_64-unknown-linux-gnu` on docs.rs as we don't have any
platform specific docs.
* Properly enable example scraping for `xilem`, `xilem_core`, and
`masonry`. Fully disable it for `xilem_web` which does not have examples
as Cargo defines them.
* Pass `--all-features` at docs.rs to match our CI and reduce the
maintenance burden of manually syncing the features list.
* Enable the `doc_auto_cfg` feature for docs.rs which will show a little
tip next to feature gated functionality informing of the crate feature
flag.
* Replaced `[!TIP]` with `💡 Tip` that was inside `<div
class="rustdoc-hidden" />`. The GitHub specific tip causes a `rustdoc`
error and [didn't even render
properly](ac2ca38785/masonry/src/doc/01_creating_app.md).
* Updated `01_creating_app.md` just enough to get `rustdoc` to pass, but
that file needs a bunch of more work, as it is outdated.
2024-11-05 11:25:36 +00:00
Olivier FAURE e03dfdd82b
Create skeleton of documentation (#632)
This is a very messy, very basic skeleton of what Masonry documentation
will eventually look like.

Main points are:

- Dedicated documentation modules.
- Re-using most of the language from the RFCs.

Next steps are:

- Flesh out the Widget documentation.
- Rewrite all those docs in a less placeholder-y way.
- Add chapter about the widget arena.
- Spread out that pass documentation to the respective pass files.
- Rewrite ARCHITECTURE.md.
- Add screenshots.

Fixes #376 and #389.

---------

Co-authored-by: Daniel McNab <36049421+DJMcNab@users.noreply.github.com>
2024-10-22 13:49:43 +00:00