Repository: zng-ui/zng (language: rust)

Issue:
Implement view-process system config reading for macOS
See [zng-view/config.rs](https://github.com/zng-ui/zng/blob/master/zng-view/src/config.rs).


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 29f223b94..cb7cbc3c5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
 # Unpublished
 
+* Implement some system config reading for macOS.
 * Add `aarch64-pc-windows-msvc` view_prebuilt.
     - Without AVIF, not tested.
 * Fix view_prebuilt in `x86_64-apple-darwin`.
diff --git a/crates/zng-view/Cargo.toml b/crates/zng-view/Cargo.toml
index fffeefd67..d260c38c9 100644
--- a/crates/zng-view/Cargo.toml
+++ b/crates/zng-view/Cargo.toml
@@ -131,10 +131,14 @@ sys-locale = "0.3"
 wayland-client = { version = "0.31", default-features = false } # matches winit
 x11-dl = "2.18.5"                                               # matches winit
 tempfile = "3.10"
-
 # xlib is re-exported by glutin/winit
 
-# prebuild profile defined in the workspace toml
+[target.'cfg(target_os = "macos")'.dependencies.objc2-app-kit]
+version = "0.2.2"
+features = [
+    "NSEvent",
+]
+
 
 [build-dependencies]
 zng-tp-licenses = { path = "../zng-tp-licenses", version = "0.2.7", features = [
@@ -148,3 +152,5 @@ targets = [
     "x86_64-pc-windows-msvc",
     "x86_64-apple-darwin",
 ]
+
+# prebuild profile defined in the workspace toml
\ No newline at end of file
diff --git a/crates/zng-view/src/config.rs b/crates/zng-view/src/config.rs
index ba5ff71a5..672d99264 100644
--- a/crates/zng-view/src/config.rs
+++ b/crates/zng-view/src/config.rs
@@ -5,6 +5,11 @@ mod windows;
 #[cfg(windows)]
 use windows as platform;
 
+#[cfg(target_os = "macos")]
+mod macos;
+#[cfg(target_os = "macos")]
+use macos as platform;
+
 #[cfg(any(
     target_os = "linux",
     target_os = "dragonfly",
@@ -25,6 +30,7 @@ use dconf as platform;
 mod other;
 #[cfg(not(any(
     windows,
+    target_os = "macos",
     target_os = "linux",
     target_os = "dragonfly",
     target_os = "freebsd",
diff --git a/crates/zng-view/src/config/macos.rs b/crates/zng-view/src/config/macos.rs
new file mode 100644
index 000000000..7085311e9
--- /dev/null
+++ b/crates/zng-view/src/config/macos.rs
@@ -0,0 +1,41 @@
+use objc2_app_kit::*;
+use zng_unit::TimeUnits as _;
+use zng_view_api::config::{AnimationsConfig, ColorScheme, FontAntiAliasing, KeyRepeatConfig, MultiClickConfig, TouchConfig};
+
+pub fn font_aa() -> FontAntiAliasing {
+    super::other::font_aa()
+}
+
+pub fn multi_click_config() -> MultiClickConfig {
+    let mut cfg = MultiClickConfig::default();
+    cfg.time = (unsafe { NSEvent::doubleClickInterval() } as f32).ms();
+    cfg
+}
+
+pub fn animations_config() -> AnimationsConfig {
+    super::other::animations_config()
+}
+
+pub fn key_repeat_config() -> KeyRepeatConfig {
+    let mut cfg = KeyRepeatConfig::default();
+    cfg.start_delay = (unsafe { NSEvent::keyRepeatDelay() } as f32).ms();
+    cfg.interval = (unsafe { NSEvent::keyRepeatInterval() } as f32).ms();
+    cfg
+}
+
+pub fn touch_config() -> TouchConfig {
+    super::other::touch_config()
+}
+
+pub fn color_scheme_config() -> ColorScheme {
+    super::other::color_scheme_config()
+}
+
+#[cfg(not(windows))]
+pub fn locale_config() -> zng_view_api::config::LocaleConfig {
+    super::other::locale_config()
+}
+
+pub fn spawn_listener(l: crate::AppEventSender) -> Option<Box<dyn FnOnce()>> {
+    super::other::spawn_listener(l)
+}


Test patch: