Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T04:37:45.610Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

window_appearance.rs

36 lines · 1.1 KB · rust
1use cocoa::{
2    appkit::{NSAppearanceNameVibrantDark, NSAppearanceNameVibrantLight},
3    base::id,
4    foundation::NSString,
5};
6use gpui::WindowAppearance;
7use objc::{msg_send, sel, sel_impl};
8use std::ffi::CStr;
9
10pub(crate) unsafe fn window_appearance_from_native(appearance: id) -> WindowAppearance {
11    let name: id = msg_send![appearance, name];
12    unsafe {
13        if name == NSAppearanceNameVibrantLight {
14            WindowAppearance::VibrantLight
15        } else if name == NSAppearanceNameVibrantDark {
16            WindowAppearance::VibrantDark
17        } else if name == NSAppearanceNameAqua {
18            WindowAppearance::Light
19        } else if name == NSAppearanceNameDarkAqua {
20            WindowAppearance::Dark
21        } else {
22            println!(
23                "unknown appearance: {:?}",
24                CStr::from_ptr(name.UTF8String())
25            );
26            WindowAppearance::Light
27        }
28    }
29}
30
31#[link(name = "AppKit", kind = "framework")]
32unsafe extern "C" {
33    pub static NSAppearanceNameAqua: id;
34    pub static NSAppearanceNameDarkAqua: id;
35}
36
Served at tenant.openagents/omega Member data and write actions are omitted.