From 9838dcf22dd0212522dd1ab5cd8d430786e7d2cf Mon Sep 17 00:00:00 2001 From: Suyog Tandel Date: Thu, 5 Feb 2026 18:37:20 +0530 Subject: [PATCH] chore(ui): add borders to button component --- src/ui/components/button.rs | 33 ++++++++++++++++++++------------- src/ui/views/config.rs | 6 ------ 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/ui/components/button.rs b/src/ui/components/button.rs index de6027b..849d649 100644 --- a/src/ui/components/button.rs +++ b/src/ui/components/button.rs @@ -1,10 +1,11 @@ #![allow(unused)] use crate::ui::colors; +use gpui::Styled; use gpui::prelude::*; use gpui::*; use gpui_component::{ - Disableable, Icon, Sizable, Size, + ActiveTheme, Disableable, Icon, Sizable, Size, button::{Button, ButtonCustomVariant, ButtonVariants}, h_flex, }; @@ -100,12 +101,15 @@ impl RenderOnce for PFButton { fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement { let text = self.text; - let mut btn = Button::new(self.id).custom( - ButtonCustomVariant::new(cx) - .color(self.bg_color_start.into()) - .hover(self.bg_color_hover.into()) - .active(self.bg_color_active.into()), - ); + let mut btn = Button::new(self.id) + .custom( + ButtonCustomVariant::new(cx) + .color(self.bg_color_start.into()) + .hover(self.bg_color_hover.into()) + .active(self.bg_color_active.into()) + .border(cx.theme().border), + ) + .border_t_1(); if self.width_full { btn = btn.w_full(); @@ -209,12 +213,15 @@ impl RenderOnce for PFIconButton { let text = self.text; let icon = self.icon; - let mut btn = Button::new("pf-icon-btn").custom( - ButtonCustomVariant::new(cx) - .color(self.bg_color_start.into()) - .hover(self.bg_color_hover.into()) - .active(self.bg_color_active.into()), - ); + let mut btn = Button::new("pf-icon-btn") + .custom( + ButtonCustomVariant::new(cx) + .color(self.bg_color_start.into()) + .hover(self.bg_color_hover.into()) + .active(self.bg_color_active.into()) + .border(cx.theme().border), + ) + .border_t_1(); if self.width_full { btn = btn.w_full(); diff --git a/src/ui/views/config.rs b/src/ui/views/config.rs index 87e31cf..0206a5d 100644 --- a/src/ui/views/config.rs +++ b/src/ui/views/config.rs @@ -309,12 +309,6 @@ impl ConfigView { let method = status.method.clone(); self._task = Some(cx.spawn(async move |_, cx| { - use std::time::Duration; - - cx.background_executor() - .timer(Duration::from_millis(500)) - .await; - let result = io::write_config(changes, method, None); let _ = entity.update(cx, |this, cx| {