Improvements for cursor
This commit is contained in:
parent
405c77bb47
commit
e20552ad13
2 changed files with 18 additions and 3 deletions
|
|
@ -7,7 +7,7 @@ use cosmic::iced_native::{
|
|||
},
|
||||
keyboard::{Event as KeyEvent, KeyCode},
|
||||
layout::{self, Layout},
|
||||
mouse::{Button, Event as MouseEvent, ScrollDelta},
|
||||
mouse::{self, Button, Event as MouseEvent, ScrollDelta},
|
||||
renderer,
|
||||
widget::{self, Widget},
|
||||
};
|
||||
|
|
@ -100,6 +100,21 @@ where
|
|||
layout::Node::new(size)
|
||||
}
|
||||
|
||||
fn mouse_interaction(
|
||||
&self,
|
||||
_tree: &widget::Tree,
|
||||
layout: Layout<'_>,
|
||||
cursor_position: Point,
|
||||
_viewport: &Rectangle,
|
||||
_renderer: &Renderer,
|
||||
) -> mouse::Interaction {
|
||||
if layout.bounds().contains(cursor_position) {
|
||||
mouse::Interaction::Text
|
||||
} else {
|
||||
mouse::Interaction::Idle
|
||||
}
|
||||
}
|
||||
|
||||
fn draw(
|
||||
&self,
|
||||
_state: &widget::Tree,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue