add sizable trait
This commit is contained in:
@@ -7,7 +7,7 @@ use gpui::{
|
||||
use gpui_native_core::avatar::Avatar;
|
||||
use gpui_native_core::button::{Button, ButtonVariant};
|
||||
use gpui_native_core::checkbox::Checkbox;
|
||||
use gpui_native_core::common::{h_flex, v_flex};
|
||||
use gpui_native_core::common::{Sizable as _, h_flex, v_flex};
|
||||
use gpui_native_core::input::{Input, InputState};
|
||||
use gpui_native_core::link::Link;
|
||||
use gpui_native_core::progress::Progress;
|
||||
@@ -206,6 +206,14 @@ impl Render for Gallery {
|
||||
.icon(IconRole::Folder),
|
||||
),
|
||||
)
|
||||
.child(
|
||||
h_flex()
|
||||
.items_center()
|
||||
.gap_2()
|
||||
.child(Button::new("gallery-button-sm").label("Small").small())
|
||||
.child(Button::new("gallery-button-md").label("Medium"))
|
||||
.child(Button::new("gallery-button-lg").label("Large").large()),
|
||||
)
|
||||
.child(
|
||||
div()
|
||||
.text_xs()
|
||||
@@ -455,8 +463,8 @@ impl Render for Gallery {
|
||||
.name("Ada Lovelace")
|
||||
.picture(Some("https://example.com/missing.png")),
|
||||
)
|
||||
.child(Avatar::new("grace@reya.info").name("Grace Hopper"))
|
||||
.child(Avatar::new("bot@reya.info")),
|
||||
.child(Avatar::new("grace@reya.info").name("Grace Hopper").small())
|
||||
.child(Avatar::new("desk@reya.info").name("Help Desk").large()),
|
||||
),
|
||||
)
|
||||
.child(
|
||||
@@ -602,10 +610,12 @@ fn main() {
|
||||
},
|
||||
|window, cx| {
|
||||
Theme::sync_from_window(window, cx);
|
||||
Theme::sync_window_rem_size(window, cx);
|
||||
// Detached on purpose: the subscription lives as long as the window.
|
||||
window
|
||||
.observe_window_appearance(|window, cx| {
|
||||
Theme::sync_from_window(window, cx);
|
||||
Theme::sync_window_rem_size(window, cx);
|
||||
cx.refresh_windows();
|
||||
})
|
||||
.detach();
|
||||
|
||||
Reference in New Issue
Block a user