chore(ui): add borders to button component

This commit is contained in:
Suyog Tandel
2026-02-05 18:37:20 +05:30
parent 4ff3e9eead
commit 9838dcf22d
2 changed files with 20 additions and 19 deletions
+20 -13
View File
@@ -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();
-6
View File
@@ -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| {