1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-03 07:10:04 -04:00

Make sure scroll bars are always visible (#2371)

* Nicer debug rectangles

* Move scrollbars into the clip-rect so they are always visible

* Improve table demo

* Add options for controlling inner and outer margin of the scroll bars

* Add line to changelog

* Update egui_extras changelog with recent Table improvements

* Refactor Table:s scroll options

* Add Table::auto_size

* Rename it auto_shrink
This commit is contained in:
Emil Ernerfeldt
2022-11-30 22:58:00 +01:00
committed by GitHub
parent 85f8eeb9d5
commit 7133818c59
8 changed files with 147 additions and 92 deletions

View File

@@ -7,6 +7,7 @@ enum ScrollDemo {
ManyLines,
LargeCanvas,
StickToEnd,
Bidirectional,
}
impl Default for ScrollDemo {
@@ -55,6 +56,7 @@ impl super::View for Scrolling {
"Scroll a large canvas",
);
ui.selectable_value(&mut self.demo, ScrollDemo::StickToEnd, "Stick to end");
ui.selectable_value(&mut self.demo, ScrollDemo::Bidirectional, "Bidirectional");
});
ui.separator();
match self.demo {
@@ -70,6 +72,14 @@ impl super::View for Scrolling {
ScrollDemo::StickToEnd => {
self.scroll_stick_to.ui(ui);
}
ScrollDemo::Bidirectional => {
egui::ScrollArea::both().show(ui, |ui| {
ui.style_mut().wrap = Some(false);
for _ in 0..100 {
ui.label(crate::LOREM_IPSUM);
}
});
}
}
}
}