From 4ae4cd615be0817e66ce11282ded81b773aba29a Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Tue, 25 Jun 2024 21:35:25 +0800 Subject: [PATCH] Fix windows max, min, close icon. --- crates/ui/src/title_bar/windows_window_controls.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/ui/src/title_bar/windows_window_controls.rs b/crates/ui/src/title_bar/windows_window_controls.rs index 78c40ba0..4d56cb87 100644 --- a/crates/ui/src/title_bar/windows_window_controls.rs +++ b/crates/ui/src/title_bar/windows_window_controls.rs @@ -1,6 +1,6 @@ use gpui::{prelude::*, Rgba, WindowAppearance}; -use crate::{prelude::*, stock::h_flex}; +use crate::{prelude::*, stock::h_flex, theme::ActiveTheme}; #[derive(IntoElement)] pub struct WindowsWindowControls { @@ -97,7 +97,8 @@ impl WindowsCaptionButton { } impl RenderOnce for WindowsCaptionButton { - fn render(self, _cx: &mut WindowContext) -> impl IntoElement { + fn render(self, cx: &mut WindowContext) -> impl IntoElement { + let theme = cx.theme(); // todo(windows) report this width to the Windows platform API // NOTE: this is intentionally hard coded. An option to use the 'native' size // could be added when the width is reported to the Windows platform API @@ -111,6 +112,8 @@ impl RenderOnce for WindowsCaptionButton { .w(width) .h_full() .text_size(px(10.0)) + .font_family("Segoe MDL2 Assets") + .text_color(theme.foreground) .hover(|style| style.bg(self.hover_background_color)) .active(|style| { let mut active_color = self.hover_background_color;