Add basic methods into NavigatedPage
This commit is contained in:
+19
-18
@@ -25,6 +25,25 @@ impl NavigatedPage<HistoryMessage> for HistoryState {
|
||||
}
|
||||
fn navigated(&mut self) {
|
||||
}
|
||||
fn update(&mut self, _: HistoryMessage) -> Task<RootMessage> {
|
||||
Task::none()
|
||||
}
|
||||
|
||||
fn view(&self) -> Element<'_, HistoryMessage> {
|
||||
back_overlay(
|
||||
iced::widget::row![
|
||||
horizontal().width(FillPortion(1)),
|
||||
scrollable(self.history_lines().padding(DEFAULT_SPACING))
|
||||
.height(Fill)
|
||||
.width(FillPortion(5)),
|
||||
horizontal().width(FillPortion(1))
|
||||
]
|
||||
.height(Fill)
|
||||
.width(Fill)
|
||||
.into(),
|
||||
Back,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl HistoryState {
|
||||
@@ -49,25 +68,7 @@ impl HistoryState {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update(&mut self, _: HistoryMessage) -> Task<RootMessage> {
|
||||
Task::none()
|
||||
}
|
||||
|
||||
pub fn view(&self) -> Element<'_, HistoryMessage> {
|
||||
back_overlay(
|
||||
iced::widget::row![
|
||||
horizontal().width(FillPortion(1)),
|
||||
scrollable(self.history_lines().padding(DEFAULT_SPACING))
|
||||
.height(Fill)
|
||||
.width(FillPortion(5)),
|
||||
horizontal().width(FillPortion(1))
|
||||
]
|
||||
.height(Fill)
|
||||
.width(Fill)
|
||||
.into(),
|
||||
Back,
|
||||
)
|
||||
}
|
||||
|
||||
fn history_lines(&self) -> Column<'_, HistoryMessage> {
|
||||
let mut column = Column::new();
|
||||
|
||||
Reference in New Issue
Block a user