mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Rework Window margins and set clip_rect_margin to zero (#7725)
* Follows https://github.com/emilk/egui/pull/7722 * Part of https://github.com/emilk/egui/issues/5605 * Closes https://github.com/emilk/egui/issues/3385 ## What Sets `clip_rect_margin` to zero, and moves the margin of `Window`s with `ScrollAreas`, so that the scroll bars are now on the very edge of the windows they are in. Windows with a bulit-in scroll area now lets the content go all the way to the edges (left image). However, if you just manually add a `ScrollArea` to a `Window`, you won't get this effect (right image). <img width="763" height="345" alt="Screenshot 2026-05-18 at 22 04 01" src="https://github.com/user-attachments/assets/e41cdfcb-b0a6-4e5e-9691-d132a602d6a7" /> ## Required * #7803 * #7804 * #7805 * #7806 * https://github.com/emilk/egui/pull/7807 * https://github.com/emilk/egui/pull/7808
This commit is contained in:
@@ -24,7 +24,7 @@ impl Custom3d {
|
||||
|
||||
impl crate::DemoApp for Custom3d {
|
||||
fn demo_ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
|
||||
// TODO(emilk): Use `ScrollArea::inner_margin`
|
||||
// TODO(emilk): Use `ScrollArea::content_margin`
|
||||
egui::CentralPanel::default().show_inside(ui, |ui| {
|
||||
egui::ScrollArea::both().auto_shrink(false).show(ui, |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
|
||||
@@ -102,7 +102,7 @@ impl Custom3d {
|
||||
|
||||
impl crate::DemoApp for Custom3d {
|
||||
fn demo_ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
|
||||
// TODO(emilk): Use `ScrollArea::inner_margin`
|
||||
// TODO(emilk): Use `ScrollArea::content_margin`
|
||||
egui::CentralPanel::default().show_inside(ui, |ui| {
|
||||
egui::ScrollArea::both().auto_shrink(false).show(ui, |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
|
||||
Reference in New Issue
Block a user