nigig-org/crates/nigig-system-prefs/Cargo.toml
2026-07-26 19:38:26 +03:00

58 lines
2.7 KiB
TOML

[package]
name = "nigig-system-prefs"
version = "0.1.0"
edition = "2021"
license = "MIT"
description = "Cross-platform system preferences reader: dark mode, locale, accent color. Follows the robius-sms pattern (cfg_if + per-platform sys/*.rs)."
repository = "https://github.com/your-org/nigig-org"
keywords = ["robius", "makepad", "dark-mode", "locale", "cross-platform"]
categories = ["os"]
[dependencies]
cfg-if = "1.0.0"
# ── Android ──────────────────────────────────────────────────────────────
[target.'cfg(target_os = "android")'.dependencies]
jni = { version = "0.21", default-features = false }
robius-android-env = "0.2.0"
# ── Windows ──────────────────────────────────────────────────────────────
[target.'cfg(target_os = "windows")'.dependencies]
windows-core = { version = "0.56", default-features = false }
windows = { version = "0.56", default-features = false, features = [
"Win32_System_Registry",
"Win32_System_SystemInformation",
"Win32_Globalization",
] }
# ── Apple (macOS / iOS) ──────────────────────────────────────────────────
# NSUserDefaults + NSLocale live in objc2-foundation, NOT objc2-app-kit.
# The feature names below are the actual cargo features exported by
# objc2-foundation 0.3.x — see:
# https://docs.rs/objc2-foundation/0.3.*/objc2_foundation/#features
[target.'cfg(target_vendor = "apple")'.dependencies]
block2 = "0.6"
objc2 = "0.6"
objc2-foundation = { version = "0.3", default-features = false, features = [
"std",
"NSString",
"NSArray",
"NSObjCRuntime",
"NSUserDefaults", # ← NSUserDefaults lives here
"NSLocale", # ← NSLocale lives here
] }
# macOS-only: NSColor.controlAccentColor comes from objc2-app-kit.
# Note: objc2-app-kit 0.3.x does NOT have an NSUserDefaults feature —
# that's on objc2-foundation. The features below are the real ones
# listed in the cargo error output (NSColor, NSApplication).
[target.'cfg(all(target_vendor = "apple", target_os = "macos"))'.dependencies]
objc2-app-kit = { version = "0.3", default-features = false, features = [
"std",
"NSColor",
"NSApplication",
] }
# ── Linux (no extra deps — uses std::process::Command + std::env) ────────
# Linux sys module reads gsettings / org.freedesktop.appearance.color-scheme
# via `gsettings get` and the LANG/LC_* env vars. No crate needed.