cacao/src/keys.rs
Ryan McGrath 4ecfbd0928
A large smattering of updates.
- Added basic animation support, via NSAnimationContext proxy objects.
  These can be used to animate layout constraints and alpha values,
  currently.

- Fixed a bug in ListView where the underlying NSTableView would not
  redraw the full correct virtual height in some conditions.

- Added safe layout guide support to some views.

- Added a new trait to buffer ObjC object access for view and control
  types. This is the supertrait of the Layout and Control traits.

- Added a Control trait, which implements various NSControl pieces.

- Added a Select control, which is a Select-ish HTML dropdown lookalike.

- Added NSURL support, which is one of the few types to expose here.

- Filesystem and pasteboard types now work with NSURLs. Users who need
  pathbufs can use the provided conversion method on NSURL.

- Fixed a bug where some Window and ViewController types could wind up
  in a double-init scenario.
2022-01-02 02:35:12 -08:00

19 lines
474 B
Rust

//! This provides some basic mapping for providing Key characters to controls. It's mostly meant as
//! a wrapper to stop magic symbols all over the place.
/// Represents a Key character.
#[derive(Debug)]
pub enum Key<'a> {
/// Behind the scenes, this translates to NSDeleteCharacter (for AppKit).
Delete,
/// Whatever character you want.
Char(&'a str)
}
impl<'a> From<&'a str> for Key<'a> {
fn from(s: &'a str) -> Self {
Key::Char(s)
}
}