Use correct cursor icons when resizing panels too wide or narrow (#4769)

This commit is contained in:
Emil Ernerfeldt 2024-07-03 14:33:11 +02:00 committed by GitHub
parent 47accb0eeb
commit bca9a04acd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 16 additions and 4 deletions

View File

@ -310,11 +310,17 @@ impl SidePanel {
if resize_hover || is_resizing { if resize_hover || is_resizing {
let cursor_icon = if width <= width_range.min { let cursor_icon = if width <= width_range.min {
CursorIcon::ResizeEast match self.side {
Side::Left => CursorIcon::ResizeEast,
Side::Right => CursorIcon::ResizeWest,
}
} else if width < width_range.max { } else if width < width_range.max {
CursorIcon::ResizeHorizontal CursorIcon::ResizeHorizontal
} else { } else {
CursorIcon::ResizeWest match self.side {
Side::Left => CursorIcon::ResizeWest,
Side::Right => CursorIcon::ResizeEast,
}
}; };
ui.ctx().set_cursor_icon(cursor_icon); ui.ctx().set_cursor_icon(cursor_icon);
} }
@ -791,11 +797,17 @@ impl TopBottomPanel {
if resize_hover || is_resizing { if resize_hover || is_resizing {
let cursor_icon = if height <= height_range.min { let cursor_icon = if height <= height_range.min {
CursorIcon::ResizeSouth match self.side {
TopBottomSide::Top => CursorIcon::ResizeSouth,
TopBottomSide::Bottom => CursorIcon::ResizeNorth,
}
} else if height < height_range.max { } else if height < height_range.max {
CursorIcon::ResizeVertical CursorIcon::ResizeVertical
} else { } else {
CursorIcon::ResizeNorth match self.side {
TopBottomSide::Top => CursorIcon::ResizeNorth,
TopBottomSide::Bottom => CursorIcon::ResizeSouth,
}
}; };
ui.ctx().set_cursor_icon(cursor_icon); ui.ctx().set_cursor_icon(cursor_icon);
} }