Add custom button demo (#86)
This commit is contained in:
parent
fc6423f22c
commit
73121123f3
1 changed files with 17 additions and 2 deletions
|
|
@ -4,8 +4,10 @@ use gpui::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use ui::{
|
use ui::{
|
||||||
button::{Button, ButtonStyle},
|
button::{Button, ButtonCustomStyle, ButtonStyle},
|
||||||
h_flex, v_flex, Clickable, Disableable as _, Icon, IconName, Selectable, Size,
|
h_flex,
|
||||||
|
theme::ActiveTheme,
|
||||||
|
v_flex, Clickable, Disableable as _, Icon, IconName, Selectable, Size,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::section;
|
use crate::section;
|
||||||
|
|
@ -60,6 +62,19 @@ impl Render for ButtonStory {
|
||||||
.label("Ghost Button")
|
.label("Ghost Button")
|
||||||
.style(ButtonStyle::Ghost)
|
.style(ButtonStyle::Ghost)
|
||||||
.on_click(Self::on_click),
|
.on_click(Self::on_click),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
Button::new("button-6-custom", cx)
|
||||||
|
.label("Custom Button")
|
||||||
|
.style(ButtonStyle::Custom(
|
||||||
|
ButtonCustomStyle::new(cx)
|
||||||
|
.color(cx.theme().muted)
|
||||||
|
.foreground(cx.theme().destructive)
|
||||||
|
.border(cx.theme().scrollbar)
|
||||||
|
.hover(cx.theme().tab_active_foreground)
|
||||||
|
.active(cx.theme().selection),
|
||||||
|
))
|
||||||
|
.on_click(Self::on_click),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue