Skip to content

Commit

Permalink
Adapt to new modal API
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdavidmackenzie authored Aug 31, 2023
1 parent ecc0dc0 commit f5b9e5b
Showing 1 changed file with 20 additions and 17 deletions.
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)

Check warning on line 239 in flowr/src/bin/flowrgui/main.rs

View check run for this annotation

Codecov / codecov/patch

flowr/src/bin/flowrgui/main.rs#L239

Added line #L239 was not covered by tests
.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(

Check warning on line 246 in flowr/src/bin/flowrgui/main.rs

View check run for this annotation

Codecov / codecov/patch

flowr/src/bin/flowrgui/main.rs#L245-L246

Added lines #L245 - L246 were not covered by tests
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))

Check warning on line 261 in flowr/src/bin/flowrgui/main.rs

View check run for this annotation

Codecov / codecov/patch

flowr/src/bin/flowrgui/main.rs#L250-L261

Added lines #L250 - L261 were not covered by tests
} else {
None

Check warning on line 263 in flowr/src/bin/flowrgui/main.rs

View check run for this annotation

Codecov / codecov/patch

flowr/src/bin/flowrgui/main.rs#L263

Added line #L263 was not covered by tests
};

modal(main, overlay)

Check warning on line 266 in flowr/src/bin/flowrgui/main.rs

View check run for this annotation

Codecov / codecov/patch

flowr/src/bin/flowrgui/main.rs#L266

Added line #L266 was not covered by tests
.backdrop(Message::CloseModal)
.on_esc(Message::CloseModal)
.into()
Expand Down

0 comments on commit f5b9e5b

Please sign in to comment.