File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
crates/egui/src/containers Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -950,6 +950,9 @@ impl Panel {
950950/// A panel that covers the remainder of the screen,
951951/// i.e. whatever area is left after adding other panels.
952952///
953+ /// This acts very similar to [`Frame::central_panel`], but always expands
954+ /// to use up all available space.
955+ ///
953956/// The order in which you add panels matter!
954957/// The first panel you add will always be the outermost, and the last you add will always be the innermost.
955958///
@@ -1022,10 +1025,15 @@ impl CentralPanel {
10221025 panel_ui. set_clip_rect ( panel_rect) ; // If we overflow, don't do so visibly (#4475)
10231026
10241027 let frame = frame. unwrap_or_else ( || Frame :: central_panel ( ui. style ( ) ) ) ;
1025- frame. show ( & mut panel_ui, |ui| {
1028+ let response = frame. show ( & mut panel_ui, |ui| {
10261029 ui. expand_to_include_rect ( ui. max_rect ( ) ) ; // Expand frame to include it all
10271030 add_contents ( ui)
1028- } )
1031+ } ) ;
1032+
1033+ // Use up space in the parent:
1034+ ui. advance_cursor_after_rect ( response. response . rect ) ;
1035+
1036+ response
10291037 }
10301038
10311039 /// Show the panel at the top level.
You can’t perform that action at this time.
0 commit comments