From 6ec3e499cbbb9015515666a51ffd773c68a5c74f Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 31 Jan 2024 10:37:10 -0700 Subject: [PATCH] Add new tab button next to window controls (#89) --- src/main.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main.rs b/src/main.rs index bffa23b..43930c7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1403,6 +1403,15 @@ impl Application for App { vec![menu_bar(&self.key_binds).into()] } + fn header_end(&self) -> Vec> { + let cosmic_theme::Spacing { space_xxs, .. } = self.core().system_theme().cosmic().spacing; + vec![widget::button(widget::icon::from_name("list-add-symbolic")) + .on_press(Message::TabNew) + .padding(space_xxs) + .style(style::Button::Icon) + .into()] + } + /// Creates a view after each update. fn view(&self) -> Element { let cosmic_theme::Spacing { space_xxs, .. } = self.core().system_theme().cosmic().spacing;