Move reusable mouse
types to iced_core
This commit is contained in:
parent
20d79a43cc
commit
56dbd68326
@ -15,9 +15,11 @@
|
||||
#![forbid(unsafe_code)]
|
||||
#![forbid(rust_2018_idioms)]
|
||||
pub mod keyboard;
|
||||
pub mod mouse;
|
||||
|
||||
mod align;
|
||||
mod background;
|
||||
mod button_state;
|
||||
mod color;
|
||||
mod font;
|
||||
mod length;
|
||||
@ -28,6 +30,7 @@ mod vector;
|
||||
|
||||
pub use align::{Align, HorizontalAlignment, VerticalAlignment};
|
||||
pub use background::Background;
|
||||
pub use button_state::ButtonState;
|
||||
pub use color::Color;
|
||||
pub use font::Font;
|
||||
pub use length::Length;
|
||||
|
6
core/src/mouse.rs
Normal file
6
core/src/mouse.rs
Normal file
@ -0,0 +1,6 @@
|
||||
//! Reuse basic mouse types.
|
||||
mod button;
|
||||
mod event;
|
||||
|
||||
pub use button::Button;
|
||||
pub use event::{Event, ScrollDelta};
|
@ -1,5 +1,5 @@
|
||||
use super::Button;
|
||||
use crate::input::ButtonState;
|
||||
use crate::ButtonState;
|
||||
|
||||
/// A mouse event.
|
||||
///
|
||||
@ -26,11 +26,11 @@ pub enum Event {
|
||||
|
||||
/// A mouse button was pressed or released.
|
||||
Input {
|
||||
/// The state of the button
|
||||
state: ButtonState,
|
||||
|
||||
/// The button identifier
|
||||
button: Button,
|
||||
|
||||
/// The state of the button
|
||||
state: ButtonState,
|
||||
},
|
||||
|
||||
/// The mouse wheel was scrolled.
|
@ -2,6 +2,4 @@
|
||||
pub mod keyboard;
|
||||
pub mod mouse;
|
||||
|
||||
mod button_state;
|
||||
|
||||
pub use button_state::ButtonState;
|
||||
pub use iced_core::ButtonState;
|
||||
|
@ -2,4 +2,4 @@
|
||||
mod event;
|
||||
|
||||
pub use event::Event;
|
||||
pub use iced_core::keyboard::{KeyCode, ModifiersState};
|
||||
pub use iced_core::keyboard::*;
|
||||
|
@ -1,9 +1,6 @@
|
||||
//! Build mouse events.
|
||||
mod button;
|
||||
mod event;
|
||||
|
||||
pub mod click;
|
||||
|
||||
pub use button::Button;
|
||||
pub use click::Click;
|
||||
pub use event::{Event, ScrollDelta};
|
||||
pub use iced_core::mouse::*;
|
||||
|
@ -185,6 +185,7 @@ mod sandbox;
|
||||
|
||||
pub mod executor;
|
||||
pub mod keyboard;
|
||||
pub mod mouse;
|
||||
pub mod settings;
|
||||
pub mod widget;
|
||||
pub mod window;
|
||||
@ -208,3 +209,6 @@ pub use runtime::{
|
||||
futures, Align, Background, Color, Command, Font, HorizontalAlignment,
|
||||
Length, Point, Size, Subscription, Vector, VerticalAlignment,
|
||||
};
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub use runtime::input::ButtonState;
|
||||
|
3
src/mouse.rs
Normal file
3
src/mouse.rs
Normal file
@ -0,0 +1,3 @@
|
||||
//! Listen and react to mouse events.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub use iced_winit::input::mouse::{Button, Event, ScrollDelta};
|
Loading…
x
Reference in New Issue
Block a user