Show embedded scrollbars only when necessary in scrollable

This commit is contained in:
Héctor Ramón Jiménez 2025-05-03 04:15:18 +02:00
parent 7a81e638a3
commit f78a87c409
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 100 additions and 50 deletions

View file

@ -168,19 +168,17 @@ impl Tour {
Screen::End => self.end(),
};
let content: Element<_> = column![screen, controls,]
.max_width(540)
.spacing(20)
.padding(20)
.into();
let content: Element<_> =
column![screen, controls].max_width(540).spacing(20).into();
let scrollable = scrollable(center_x(if self.debug {
content.explain(Color::BLACK)
} else {
content
}));
}))
.spacing(10);
center_y(scrollable).into()
center_y(scrollable).padding(10).into()
}
fn can_continue(&self) -> bool {

View file

@ -104,6 +104,7 @@ impl WebSocket {
)
.id(MESSAGE_LOG.clone())
.height(Fill)
.spacing(10)
.into()
};