Skip to content

Commit bca9a04

Browse files
authored
Use correct cursor icons when resizing panels too wide or narrow (#4769)
1 parent 47accb0 commit bca9a04

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

crates/egui/src/containers/panel.rs

+16-4
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,17 @@ impl SidePanel {
310310

311311
if resize_hover || is_resizing {
312312
let cursor_icon = if width <= width_range.min {
313-
CursorIcon::ResizeEast
313+
match self.side {
314+
Side::Left => CursorIcon::ResizeEast,
315+
Side::Right => CursorIcon::ResizeWest,
316+
}
314317
} else if width < width_range.max {
315318
CursorIcon::ResizeHorizontal
316319
} else {
317-
CursorIcon::ResizeWest
320+
match self.side {
321+
Side::Left => CursorIcon::ResizeWest,
322+
Side::Right => CursorIcon::ResizeEast,
323+
}
318324
};
319325
ui.ctx().set_cursor_icon(cursor_icon);
320326
}
@@ -791,11 +797,17 @@ impl TopBottomPanel {
791797

792798
if resize_hover || is_resizing {
793799
let cursor_icon = if height <= height_range.min {
794-
CursorIcon::ResizeSouth
800+
match self.side {
801+
TopBottomSide::Top => CursorIcon::ResizeSouth,
802+
TopBottomSide::Bottom => CursorIcon::ResizeNorth,
803+
}
795804
} else if height < height_range.max {
796805
CursorIcon::ResizeVertical
797806
} else {
798-
CursorIcon::ResizeNorth
807+
match self.side {
808+
TopBottomSide::Top => CursorIcon::ResizeNorth,
809+
TopBottomSide::Bottom => CursorIcon::ResizeSouth,
810+
}
799811
};
800812
ui.ctx().set_cursor_icon(cursor_icon);
801813
}

0 commit comments

Comments
 (0)