From 5149b8a7141f389eae90ba63ff250a4559e81129 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Sun, 10 Nov 2024 23:17:34 +0800 Subject: [PATCH] panel: Add `toolbar_buttons` to extend button to panel. (#406) image --- crates/story/src/lib.rs | 16 +++++++++++++++- crates/ui/src/dock/panel.rs | 12 +++++++++++- crates/ui/src/dock/tab_panel.rs | 23 ++++++++++++++++++----- 3 files changed, 44 insertions(+), 7 deletions(-) diff --git a/crates/story/src/lib.rs b/crates/story/src/lib.rs index 33a8aae7..71dd1480 100644 --- a/crates/story/src/lib.rs +++ b/crates/story/src/lib.rs @@ -44,6 +44,7 @@ use gpui::{ }; use ui::{ + button::Button, divider::Divider, dock::{register_panel, DockItemInfo, DockItemState, Panel, PanelEvent, TitleStyle}, h_flex, @@ -51,7 +52,7 @@ use ui::{ notification::Notification, popup_menu::PopupMenu, theme::ActiveTheme, - v_flex, ContextModal, + v_flex, ContextModal, IconName, }; const PANEL_NAME: &str = "StoryContainer"; @@ -296,6 +297,19 @@ impl Panel for StoryContainer { .menu("Info", Box::new(PanelInfo)) } + fn toolbar_buttons(&self, _cx: &WindowContext) -> Vec