mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 14:20:04 -04:00
Move window resize interaction to be over contents (#7807)
When resizing a window, it makes more sense that the resize "splitters" are on top of the content. It makes them easier to hit.
This commit is contained in:
@@ -542,7 +542,7 @@ impl Window<'_> {
|
|||||||
|
|
||||||
// First check for resize to avoid frame delay:
|
// First check for resize to avoid frame delay:
|
||||||
let last_frame_outer_rect = area.state().rect();
|
let last_frame_outer_rect = area.state().rect();
|
||||||
let resize_interaction = resize_interaction(
|
let resize_interaction = do_resize_interaction(
|
||||||
ctx,
|
ctx,
|
||||||
possible,
|
possible,
|
||||||
area.id(),
|
area.id(),
|
||||||
@@ -623,6 +623,17 @@ impl Window<'_> {
|
|||||||
.map_or((None, None), |ir| (Some(ir.inner), Some(ir.response)));
|
.map_or((None, None), |ir| (Some(ir.inner), Some(ir.response)));
|
||||||
|
|
||||||
let outer_rect = frame.end(&mut area_content_ui).rect;
|
let outer_rect = frame.end(&mut area_content_ui).rect;
|
||||||
|
|
||||||
|
// Do resize interaction _again_, to move their widget rectangles on TOP of the rest of the window.
|
||||||
|
let resize_interaction = do_resize_interaction(
|
||||||
|
ctx,
|
||||||
|
possible,
|
||||||
|
area.id(),
|
||||||
|
area_layer_id,
|
||||||
|
last_frame_outer_rect,
|
||||||
|
window_frame,
|
||||||
|
);
|
||||||
|
|
||||||
paint_resize_corner(
|
paint_resize_corner(
|
||||||
&area_content_ui,
|
&area_content_ui,
|
||||||
&possible,
|
&possible,
|
||||||
@@ -924,7 +935,7 @@ fn move_and_resize_window(ctx: &Context, id: Id, interaction: &ResizeInteraction
|
|||||||
Some(rect.round_ui())
|
Some(rect.round_ui())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn resize_interaction(
|
fn do_resize_interaction(
|
||||||
ctx: &Context,
|
ctx: &Context,
|
||||||
possible: PossibleInteractions,
|
possible: PossibleInteractions,
|
||||||
_accessibility_parent: Id,
|
_accessibility_parent: Id,
|
||||||
|
|||||||
Reference in New Issue
Block a user