Skip to content

Commit

Permalink
Hide Trash icon on empty chat
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Jul 20, 2024
1 parent 7a32dd7 commit ca2a23a
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/screen/conversation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,14 +379,19 @@ impl Conversation {
tip::Position::Right,
);

let delete = tip(
button(icon::trash().style(text::danger))
.padding(0)
.on_press(Message::Delete)
.style(button::text),
"Delete Chat",
tip::Position::Left,
);
let delete: Element<_> = if self.id.is_some() {
tip(

Check warning on line 383 in src/screen/conversation.rs

View workflow job for this annotation

GitHub Actions / all

useless conversion to the same type: `iced_core::element::Element<'_, screen::conversation::Message, iced::Theme, iced_renderer::fallback::Renderer<iced_wgpu::Renderer, iced_tiny_skia::Renderer>>`
button(icon::trash().style(text::danger))
.padding(0)
.on_press(Message::Delete)
.style(button::text),
"Delete Chat",
tip::Position::Left,
)
.into()
} else {
horizontal_space().into()
};

let bar = stack![title, row![toggle_sidebar, horizontal_space(), delete]].into();

Expand Down

0 comments on commit ca2a23a

Please sign in to comment.