Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add click handlers to some of the buttons in the `StatusBar`

Marshall Bowersc142676b20a9
diff --git a/crates/ui2/src/components/status_bar.rs b/crates/ui2/src/components/status_bar.rs
index e4ec2dda81d..b9ea7608f67 100644
--- a/crates/ui2/src/components/status_bar.rs
+++ b/crates/ui2/src/components/status_bar.rs
@@ -119,7 +119,9 @@ impl<S: 'static + Send + Sync + Clone> StatusBar<S> {
.items_center()
.gap_1()
.child(Button::new("116:25"))
- .child(Button::new("Rust")),
+ .child(
+ Button::new("Rust").on_click(|_, _| println!("Select Language clicked.")),
+ ),
)
.child(ToolDivider::new())
.child(
@@ -127,8 +129,14 @@ impl<S: 'static + Send + Sync + Clone> StatusBar<S> {
.flex()
.items_center()
.gap_1()
- .child(IconButton::new(Icon::Copilot))
- .child(IconButton::new(Icon::Envelope)),
+ .child(
+ IconButton::new(Icon::Copilot)
+ .on_click(|_, _| println!("Copilot clicked.")),
+ )
+ .child(
+ IconButton::new(Icon::Envelope)
+ .on_click(|_, _| println!("Send Feedback clicked.")),
+ ),
)
.child(ToolDivider::new())
.child(
@@ -137,7 +145,10 @@ impl<S: 'static + Send + Sync + Clone> StatusBar<S> {
.items_center()
.gap_1()
.child(IconButton::new(Icon::Terminal))
- .child(IconButton::new(Icon::MessageBubbles))
+ .child(
+ IconButton::new(Icon::MessageBubbles)
+ .on_click(|_, _| println!("Chat Panel clicked.")),
+ )
.child(IconButton::new(Icon::Ai)),
)
}