Skip to content

Commit

Permalink
Use iced_aw 0.70.0 (#2016)
Browse files Browse the repository at this point in the history
* Use iced_aw 0.70.0

Should have the fixes I need

* Adapt to new modal API
  • Loading branch information
andrewdavidmackenzie authored Aug 31, 2023
1 parent 7b9ddf9 commit 1792d91
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion flowr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ wasmtime = { version = "12.0.1", default-features = false, features = ["cranelif

# for flowrgui
iced = { version = "0.10.0", features = ["canvas", "tokio", "debug", "image"] }
iced_aw = { version = "0.6.0", git = "https://github.com/iced-rs/iced_aw.git", branch="main", default-features = false, features = ["tabs", "card", "modal",] }
iced_aw = { version = "0.7.0", default-features = false, features = ["tabs", "card", "modal",] }
iced_native = "0.10.3"
once_cell = "1.18.0"
tokio = { version = "1", features = ["sync"] }
Expand Down
37 changes: 20 additions & 17 deletions flowr/src/bin/flowrgui/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,31 +236,34 @@ impl Application for FlowrGui {
}

fn view(&self) -> Element<'_, Message> {
let mut main = Column::new().spacing(10);

main = main
let main = Column::new().spacing(10)
.push(self.command_row())
.push(self.tab_set.view())
.push(self.status_row())
.padding(10);

modal(self.show_modal, main,
Card::new(
let overlay = if self.show_modal {
Some(Card::new(
Text::new(self.modal_content.clone().0),
Text::new(self.modal_content.clone().1),
)
.foot(
Row::new()
.spacing(10)
.padding(5)
.width(Length::Fill)
.push(
Button::new(Text::new("OK")
.horizontal_alignment(Horizontal::Center))
.width(Length::Fill)
.on_press(Message::CloseModal)),
)
.max_width(300.0))
.foot(
Row::new()
.spacing(10)
.padding(5)
.width(Length::Fill)
.push(
Button::new(Text::new("OK")
.horizontal_alignment(Horizontal::Center))
.width(Length::Fill)
.on_press(Message::CloseModal)),
)
.max_width(300.0))
} else {
None
};

modal(main, overlay)
.backdrop(Message::CloseModal)
.on_esc(Message::CloseModal)
.into()
Expand Down

0 comments on commit 1792d91

Please sign in to comment.