diff --git a/crates/ui/src/title_bar/windows_window_controls.rs b/crates/ui/src/title_bar/windows_window_controls.rs index 4d56cb87..3cdc81f6 100644 --- a/crates/ui/src/title_bar/windows_window_controls.rs +++ b/crates/ui/src/title_bar/windows_window_controls.rs @@ -94,6 +94,25 @@ impl WindowsCaptionButton { hover_background_color, } } + + #[cfg(not(target_os = "windows"))] + fn get_font() -> &'static str { + "Segoe Fluent Icons" + } + + #[cfg(target_os = "windows")] + fn get_font() -> &'static str { + use windows::Wdk::System::SystemServices::RtlGetVersion; + + let mut version = unsafe { std::mem::zeroed() }; + let status = unsafe { RtlGetVersion(&mut version) }; + + if status.is_ok() && version.dwBuildNumber >= 22000 { + "Segoe Fluent Icons" + } else { + "Segoe MDL2 Assets" + } + } } impl RenderOnce for WindowsCaptionButton { @@ -112,7 +131,7 @@ impl RenderOnce for WindowsCaptionButton { .w(width) .h_full() .text_size(px(10.0)) - .font_family("Segoe MDL2 Assets") + .font_family(Self::get_font()) .text_color(theme.foreground) .hover(|style| style.bg(self.hover_background_color)) .active(|style| {