5cd59b5636
- Beginning to transition View types to use Rc/RefCell internally, which should provide better guarantees about ownership on the Rust side. This is also important for certain Objective-C side scenarios where we may need to set an ivar after creation, which requires some level of mutability. This may also possibly help bring down the unsafe usage, which would be cool. - Rewrote the Color module; this now handles system colors better, and provides support for dynamic color creation. Supporting combinations of dark/light/contrast is now possible with handler passed in via `Color::dynamic`. This still has work to do in terms of some accessor methods and such, but it works well for now. The `to_platform...` method should be removed before v0.1. - Added a new feature for enabling fallback color usage on older macOS versions that don't support system colors. This may honestly never be used, but it cost nothing to implement. - Fixed a bug in the Autolayout wrapper where dereferencing could cause constraints to crash at runtime. - Support setting text color on labels. - Support setting text color on buttons, albeit very hacky right now. This needs to be extracted and/or cleaned up, but getting it sketched out was important for this commit. - Support setting a key equivalent on buttons. - Creating a local event monitor is now possible. - Examples updated; Calculator clone example added. The only API breaking change in this commit from earlier commits should be `color::rgb` needing to be `color::Color` followed by a `Color::rgb(...)` call. |
||
---|---|---|
.. | ||
add | ||
preferences | ||
storage | ||
todos | ||
app.rs | ||
main.rs | ||
menu.rs | ||
README.md | ||
windows.rs |
Tasks Example
This example implements a "full featured" macOS app, completely in Rust. Notably, it showcases the following:
- Working menu(s), with dispatchable actions.
- A cached, reusable
ListView
.- Cell configuration and styling.
- Row actions: complete a task, mark a task as incomplete.
- Basic animation support.
- Self-sizing rows based on autolayout.
- Custom widget composition (see
preferences/toggle_option_view.rs
. - Multiple windows.
- Toolbars per-window.
- Button and Toolbar Items, with actions.
- Running a window as a modal sheet.
- Autolayout to handle UI across the board.
- Message dispatch (a bit jank, but hey, that's fine for now).
- Standard "Preferences" screens
- A general and advanced pane, with pane selection.
- Looks correct on both Big Sur, as well as Catalina and earlier.
While the Cacao API is still subject to changes and revisions, this hopefully illustrates what's possible with everything as it currently exists, and provides an entry point for outside contributors to get their feet wet.