1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 21:30:03 -04:00

Add Response::on_hover_and_drag_cursor

This commit is contained in:
Emil Ernerfeldt
2022-12-21 17:47:52 +01:00
parent a68c891092
commit fa0d7f7f7f
2 changed files with 9 additions and 0 deletions

View File

@@ -459,6 +459,14 @@ impl Response {
self
}
/// When hovered or dragged, use this icon for the mouse cursor.
pub fn on_hover_and_drag_cursor(self, cursor: CursorIcon) -> Self {
if self.hovered() || self.dragged() {
self.ctx.output().cursor_icon = cursor;
}
self
}
/// Check for more interactions (e.g. sense clicks on a [`Response`] returned from a label).
///
/// Note that this call will not add any hover-effects to the widget, so when possible