chore; make tui pass clippy
This commit is contained in:
1 parent
40c88eeb4b
commit
58a20913b6
7 files changed
+36
-28
No files matched your search
@@ -1,20 +1,23 @@
|
||||
[package]
|
||||
name = "rink"
|
||||
name = "dioxus-tui"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
|
||||
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
tui = "0.17.0"
|
||||
crossterm = "0.22.1"
|
||||
crossterm = "0.23.0"
|
||||
anyhow = "1.0.42"
|
||||
thiserror = "1.0.24"
|
||||
dioxus = "0.1.8"
|
||||
dioxus-html = "0.1.6"
|
||||
dioxus-core = { path = "../core" }
|
||||
dioxus-html = { path = "../html" }
|
||||
hecs = "0.7.3"
|
||||
ctrlc = "3.2.1"
|
||||
bumpalo = { version = "3.8.0", features = ["boxed"] }
|
||||
tokio = { version = "1.15.0", features = ["full"] }
|
||||
futures = "0.3.19"
|
||||
stretch2 = { git = "https://github.com/DioxusLabs/stretch" }
|
||||
stretch2 = "0.4.0"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crossterm::event::{
|
||||
Event as TermEvent, KeyCode as TermKeyCode, KeyModifiers, MouseButton, MouseEventKind,
|
||||
};
|
||||
use dioxus::core::*;
|
||||
use dioxus_core::*;
|
||||
|
||||
use dioxus_html::{on::*, KeyCode};
|
||||
use futures::{channel::mpsc::UnboundedReceiver, StreamExt};
|
||||
@@ -146,7 +146,7 @@ impl InnerInputState {
|
||||
}
|
||||
},
|
||||
EventData::Wheel(ref w) => self.wheel = Some(clone_wheel_data(w)),
|
||||
EventData::Screen(ref s) => self.screen = Some(s.clone()),
|
||||
EventData::Screen(ref s) => self.screen = Some(*s),
|
||||
EventData::Keyboard(ref mut k) => {
|
||||
let repeat = self
|
||||
.last_key_pressed
|
||||
@@ -177,7 +177,7 @@ impl InnerInputState {
|
||||
wheel_delta: f64,
|
||||
mouse_data: &'b MouseData,
|
||||
wheel_data: &'b Option<WheelData>,
|
||||
};
|
||||
}
|
||||
|
||||
fn layout_contains_point(layout: &Layout, point: (i32, i32)) -> bool {
|
||||
layout.location.x as i32 <= point.0
|
||||
@@ -292,11 +292,9 @@ impl InnerInputState {
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if previously_contained {
|
||||
try_create_event("mouseleave");
|
||||
try_create_event("mouseout");
|
||||
}
|
||||
} else if previously_contained {
|
||||
try_create_event("mouseleave");
|
||||
try_create_event("mouseout");
|
||||
}
|
||||
events
|
||||
}
|
||||
@@ -399,7 +397,7 @@ impl RinkInputHandler {
|
||||
) -> Vec<UserEvent> {
|
||||
// todo: currently resolves events in all nodes, but once the focus system is added it should filter by focus
|
||||
fn inner(
|
||||
queue: &Vec<(&'static str, Arc<dyn Any + Send + Sync>)>,
|
||||
queue: &[(&'static str, Arc<dyn Any + Send + Sync>)],
|
||||
resolved: &mut Vec<UserEvent>,
|
||||
node: &VNode,
|
||||
) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use dioxus::core::*;
|
||||
use dioxus_core::*;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::{
|
||||
|
||||
@@ -4,8 +4,8 @@ use crossterm::{
|
||||
execute,
|
||||
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
|
||||
};
|
||||
use dioxus::core::exports::futures_channel::mpsc::unbounded;
|
||||
use dioxus::core::*;
|
||||
use dioxus_core::exports::futures_channel::mpsc::unbounded;
|
||||
use dioxus_core::*;
|
||||
use futures::{channel::mpsc::UnboundedSender, pin_mut, StreamExt};
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
@@ -208,6 +208,8 @@ pub fn render_vdom(
|
||||
|
||||
enum InputEvent {
|
||||
UserInput(TermEvent),
|
||||
Close,
|
||||
Tick,
|
||||
|
||||
#[allow(dead_code)]
|
||||
Close,
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
use dioxus::core::*;
|
||||
use dioxus_core::*;
|
||||
use std::{collections::HashMap, io::Stdout};
|
||||
use stretch2::{
|
||||
geometry::Point,
|
||||
|
||||
@@ -435,13 +435,13 @@ impl RinkStyle {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<Style> for RinkStyle {
|
||||
fn into(self) -> Style {
|
||||
impl From<RinkStyle> for Style {
|
||||
fn from(val: RinkStyle) -> Self {
|
||||
Style {
|
||||
fg: self.fg.map(|c| c.color),
|
||||
bg: self.bg.map(|c| c.color),
|
||||
add_modifier: self.add_modifier,
|
||||
sub_modifier: self.sub_modifier,
|
||||
fg: val.fg.map(|c| c.color),
|
||||
bg: val.bg.map(|c| c.color),
|
||||
add_modifier: val.add_modifier,
|
||||
sub_modifier: val.sub_modifier,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user