Compare commits
9 commits
b19806af97
...
f800b57b26
Author | SHA1 | Date | |
---|---|---|---|
Alex Janka | f800b57b26 | ||
Alex Janka | c8c85c2580 | ||
Alex Janka | 6952cc2429 | ||
Alex Janka | 5db4785825 | ||
Alex Janka | ac2cc95c64 | ||
Alex Janka | 22b322cdfb | ||
Alex Janka | 1655ece898 | ||
Alex Janka | 631f53214c | ||
Alex Janka | 671f29e56d |
|
@ -218,6 +218,12 @@ impl Image {
|
||||||
/// ever exposes a compatible API, this can be tweaked in a PR.
|
/// ever exposes a compatible API, this can be tweaked in a PR.
|
||||||
#[cfg(any(target_os = "macos", target_os = "ios"))]
|
#[cfg(any(target_os = "macos", target_os = "ios"))]
|
||||||
pub fn symbol(symbol: SFSymbol, accessibility_description: &str) -> Self {
|
pub fn symbol(symbol: SFSymbol, accessibility_description: &str) -> Self {
|
||||||
|
Self::custom_symbol(symbol.to_str(), accessibility_description)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Creates and returns an Image with an arbitrary `SFSymbol`
|
||||||
|
pub fn custom_symbol(symbol: &str, accessibility_description: &str) -> Self {
|
||||||
|
println!("custom symbol name: {symbol}");
|
||||||
// SFSymbols is macOS 11.0+
|
// SFSymbols is macOS 11.0+
|
||||||
#[cfg(feature = "appkit")]
|
#[cfg(feature = "appkit")]
|
||||||
let min_version = 11;
|
let min_version = 11;
|
||||||
|
@ -229,7 +235,7 @@ impl Image {
|
||||||
Image(unsafe {
|
Image(unsafe {
|
||||||
match os::is_minimum_version(min_version) {
|
match os::is_minimum_version(min_version) {
|
||||||
true => {
|
true => {
|
||||||
let icon = NSString::new(symbol.to_str());
|
let icon = NSString::new(symbol);
|
||||||
let desc = NSString::new(accessibility_description);
|
let desc = NSString::new(accessibility_description);
|
||||||
msg_send_id![
|
msg_send_id![
|
||||||
Self::class(),
|
Self::class(),
|
||||||
|
|
Loading…
Reference in a new issue