remove derive_more
This commit is contained in:
parent
a725ded95e
commit
82956b618a
3 changed files with 39 additions and 47 deletions
39
Cargo.lock
generated
39
Cargo.lock
generated
|
@ -1160,12 +1160,6 @@ dependencies = [
|
||||||
"theme",
|
"theme",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "convert_case"
|
|
||||||
version = "0.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "core-foundation"
|
name = "core-foundation"
|
||||||
version = "0.9.3"
|
version = "0.9.3"
|
||||||
|
@ -1578,19 +1572,6 @@ dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "derive_more"
|
|
||||||
version = "0.99.17"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
|
|
||||||
dependencies = [
|
|
||||||
"convert_case",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"rustc_version 0.4.0",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dhat"
|
name = "dhat"
|
||||||
version = "0.3.1"
|
version = "0.3.1"
|
||||||
|
@ -2407,7 +2388,6 @@ dependencies = [
|
||||||
"core-graphics",
|
"core-graphics",
|
||||||
"core-text",
|
"core-text",
|
||||||
"ctor",
|
"ctor",
|
||||||
"derive_more",
|
|
||||||
"dhat",
|
"dhat",
|
||||||
"env_logger",
|
"env_logger",
|
||||||
"etagere",
|
"etagere",
|
||||||
|
@ -3965,7 +3945,7 @@ version = "0.5.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "39fe46acc5503595e5949c17b818714d26fdf9b4920eacf3b2947f0199f4a6ff"
|
checksum = "39fe46acc5503595e5949c17b818714d26fdf9b4920eacf3b2947f0199f4a6ff"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rustc_version 0.3.3",
|
"rustc_version",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -4917,16 +4897,7 @@ version = "0.3.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee"
|
checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"semver 0.11.0",
|
"semver",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rustc_version"
|
|
||||||
version = "0.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
|
|
||||||
dependencies = [
|
|
||||||
"semver 1.0.14",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -5181,12 +5152,6 @@ dependencies = [
|
||||||
"semver-parser",
|
"semver-parser",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "semver"
|
|
||||||
version = "1.0.14"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "semver-parser"
|
name = "semver-parser"
|
||||||
version = "0.10.2"
|
version = "0.10.2"
|
||||||
|
|
|
@ -20,7 +20,6 @@ sum_tree = { path = "../sum_tree" }
|
||||||
async-task = "4.0.3"
|
async-task = "4.0.3"
|
||||||
backtrace = { version = "0.3", optional = true }
|
backtrace = { version = "0.3", optional = true }
|
||||||
ctor = "0.1"
|
ctor = "0.1"
|
||||||
derive_more = "0.99.17"
|
|
||||||
dhat = { version = "0.3", optional = true }
|
dhat = { version = "0.3", optional = true }
|
||||||
env_logger = { version = "0.9", optional = true }
|
env_logger = { version = "0.9", optional = true }
|
||||||
etagere = "0.2"
|
etagere = "0.2"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use derive_more::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
use crate::{geometry::vector::Vector2F, keymap::Keystroke};
|
use crate::{geometry::vector::Vector2F, keymap::Keystroke};
|
||||||
|
|
||||||
|
@ -22,12 +22,19 @@ pub struct Modifiers {
|
||||||
pub fun: bool,
|
pub fun: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Default, Deref)]
|
#[derive(Clone, Copy, Debug, Default)]
|
||||||
pub struct ModifiersChangedEvent {
|
pub struct ModifiersChangedEvent {
|
||||||
#[deref]
|
|
||||||
pub modifiers: Modifiers,
|
pub modifiers: Modifiers,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Deref for ModifiersChangedEvent {
|
||||||
|
type Target = Modifiers;
|
||||||
|
|
||||||
|
fn deref(&self) -> &Self::Target {
|
||||||
|
&self.modifiers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// The phase of a touch motion event.
|
/// The phase of a touch motion event.
|
||||||
/// Based on the winit enum of the same name,
|
/// Based on the winit enum of the same name,
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
|
@ -37,17 +44,24 @@ pub enum TouchPhase {
|
||||||
Ended,
|
Ended,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Default, Deref)]
|
#[derive(Clone, Copy, Debug, Default)]
|
||||||
pub struct ScrollWheelEvent {
|
pub struct ScrollWheelEvent {
|
||||||
pub position: Vector2F,
|
pub position: Vector2F,
|
||||||
pub delta: Vector2F,
|
pub delta: Vector2F,
|
||||||
pub precise: bool,
|
pub precise: bool,
|
||||||
#[deref]
|
|
||||||
pub modifiers: Modifiers,
|
pub modifiers: Modifiers,
|
||||||
/// If the platform supports returning the phase of a scroll wheel event, it will be stored here
|
/// If the platform supports returning the phase of a scroll wheel event, it will be stored here
|
||||||
pub phase: Option<TouchPhase>,
|
pub phase: Option<TouchPhase>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Deref for ScrollWheelEvent {
|
||||||
|
type Target = Modifiers;
|
||||||
|
|
||||||
|
fn deref(&self) -> &Self::Target {
|
||||||
|
&self.modifiers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Hash, PartialEq, Eq, Copy, Clone, Debug)]
|
#[derive(Hash, PartialEq, Eq, Copy, Clone, Debug)]
|
||||||
pub enum NavigationDirection {
|
pub enum NavigationDirection {
|
||||||
Back,
|
Back,
|
||||||
|
@ -86,23 +100,37 @@ impl Default for MouseButton {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Default, Deref)]
|
#[derive(Clone, Copy, Debug, Default)]
|
||||||
pub struct MouseButtonEvent {
|
pub struct MouseButtonEvent {
|
||||||
pub button: MouseButton,
|
pub button: MouseButton,
|
||||||
pub position: Vector2F,
|
pub position: Vector2F,
|
||||||
#[deref]
|
|
||||||
pub modifiers: Modifiers,
|
pub modifiers: Modifiers,
|
||||||
pub click_count: usize,
|
pub click_count: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Default, Deref)]
|
impl Deref for MouseButtonEvent {
|
||||||
|
type Target = Modifiers;
|
||||||
|
|
||||||
|
fn deref(&self) -> &Self::Target {
|
||||||
|
&self.modifiers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Copy, Debug, Default)]
|
||||||
pub struct MouseMovedEvent {
|
pub struct MouseMovedEvent {
|
||||||
pub position: Vector2F,
|
pub position: Vector2F,
|
||||||
pub pressed_button: Option<MouseButton>,
|
pub pressed_button: Option<MouseButton>,
|
||||||
#[deref]
|
|
||||||
pub modifiers: Modifiers,
|
pub modifiers: Modifiers,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Deref for MouseMovedEvent {
|
||||||
|
type Target = Modifiers;
|
||||||
|
|
||||||
|
fn deref(&self) -> &Self::Target {
|
||||||
|
&self.modifiers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl MouseMovedEvent {
|
impl MouseMovedEvent {
|
||||||
pub fn to_button_event(&self, button: MouseButton) -> MouseButtonEvent {
|
pub fn to_button_event(&self, button: MouseButton) -> MouseButtonEvent {
|
||||||
MouseButtonEvent {
|
MouseButtonEvent {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue