move rink over to the new event system
This commit is contained in:
1 parent
93cbfd0dbc
commit
0ef765e060
6 files changed
+86
-70
No files matched your search
@@ -1,6 +1,6 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use dioxus_html::input_data::keyboard_types::Key;
|
||||
use dioxus_html::{input_data::keyboard_types::Key, HasKeyboardData};
|
||||
use dioxus_native_core::{
|
||||
custom_element::CustomElement,
|
||||
node::OwnedAttributeDiscription,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use dioxus_html::input_data::keyboard_types::Key;
|
||||
use dioxus_html::{input_data::keyboard_types::Key, HasKeyboardData};
|
||||
use dioxus_native_core::{
|
||||
custom_element::CustomElement,
|
||||
node::OwnedAttributeDiscription,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use dioxus_html::input_data::keyboard_types::Key;
|
||||
use dioxus_html::{input_data::keyboard_types::Key, HasKeyboardData};
|
||||
use dioxus_native_core::{
|
||||
custom_element::CustomElement,
|
||||
real_dom::{NodeImmutable, RealDom},
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use dioxus_html::{
|
||||
input_data::keyboard_types::Key, prelude::PointInteraction, KeyboardData, MouseData,
|
||||
input_data::keyboard_types::Key, prelude::PointInteraction, HasKeyboardData,
|
||||
SerializedKeyboardData, SerializedMouseData,
|
||||
};
|
||||
use dioxus_native_core::{
|
||||
custom_element::CustomElement,
|
||||
@@ -211,7 +212,7 @@ impl Slider {
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_keydown(&mut self, mut root: NodeMut, data: &KeyboardData) {
|
||||
fn handle_keydown(&mut self, mut root: NodeMut, data: &SerializedKeyboardData) {
|
||||
let key = data.key();
|
||||
|
||||
let step = self.step();
|
||||
@@ -233,7 +234,7 @@ impl Slider {
|
||||
self.write_value(rdom, id);
|
||||
}
|
||||
|
||||
fn handle_mousemove(&mut self, mut root: NodeMut, data: &MouseData) {
|
||||
fn handle_mousemove(&mut self, mut root: NodeMut, data: &SerializedMouseData) {
|
||||
if !data.held_buttons().is_empty() {
|
||||
let id = root.id();
|
||||
let rdom = root.real_dom_mut();
|
||||
|
||||
@@ -2,7 +2,8 @@ use std::{collections::HashMap, io::stdout};
|
||||
|
||||
use crossterm::{cursor::MoveTo, execute};
|
||||
use dioxus_html::{
|
||||
input_data::keyboard_types::Key, prelude::PointInteraction, KeyboardData, MouseData,
|
||||
input_data::keyboard_types::Key, prelude::PointInteraction, HasKeyboardData,
|
||||
SerializedKeyboardData, SerializedMouseData,
|
||||
};
|
||||
use dioxus_native_core::{
|
||||
custom_element::CustomElement,
|
||||
@@ -186,7 +187,7 @@ impl<C: TextLikeController> TextLike<C> {
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_keydown(&mut self, mut root: NodeMut, data: &KeyboardData) {
|
||||
fn handle_keydown(&mut self, mut root: NodeMut, data: &SerializedKeyboardData) {
|
||||
let key = data.key();
|
||||
let modifiers = data.modifiers();
|
||||
let code = data.code();
|
||||
@@ -230,7 +231,7 @@ impl<C: TextLikeController> TextLike<C> {
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_mousemove(&mut self, mut root: NodeMut, data: &MouseData) {
|
||||
fn handle_mousemove(&mut self, mut root: NodeMut, data: &SerializedMouseData) {
|
||||
if self.dragging {
|
||||
let id = root.id();
|
||||
let offset = data.element_coordinates();
|
||||
@@ -247,7 +248,7 @@ impl<C: TextLikeController> TextLike<C> {
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_mousedown(&mut self, mut root: NodeMut, data: &MouseData) {
|
||||
fn handle_mousedown(&mut self, mut root: NodeMut, data: &SerializedMouseData) {
|
||||
let offset = data.element_coordinates();
|
||||
let mut new = Pos::new(offset.x as usize, offset.y as usize);
|
||||
|
||||
|
||||
Reference in new issue
Block a user