Split Input mouse event by ButtonState
This commit is contained in:
parent
e139aae143
commit
e55cd9652e
11 changed files with 180 additions and 203 deletions
|
|
@ -1,7 +1,6 @@
|
|||
//! Create choices using radio buttons.
|
||||
use crate::{
|
||||
input::{mouse, ButtonState},
|
||||
layout, row, text, Align, Clipboard, Element, Event, Hasher,
|
||||
input::mouse, layout, row, text, Align, Clipboard, Element, Event, Hasher,
|
||||
HorizontalAlignment, Layout, Length, Point, Rectangle, Row, Text,
|
||||
VerticalAlignment, Widget,
|
||||
};
|
||||
|
|
@ -123,10 +122,7 @@ where
|
|||
_clipboard: Option<&dyn Clipboard>,
|
||||
) {
|
||||
match event {
|
||||
Event::Mouse(mouse::Event::Input {
|
||||
button: mouse::Button::Left,
|
||||
state: ButtonState::Pressed,
|
||||
}) => {
|
||||
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left)) => {
|
||||
if layout.bounds().contains(cursor_position) {
|
||||
messages.push(self.on_click.clone());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue