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
+8
-3
@@ -17,7 +17,6 @@ dioxus-html = { path = "./packages/html", version = "^0.1.6", optional = true }
|
|||||||
dioxus-core-macro = { path = "./packages/core-macro", version = "^0.1.7", optional = true }
|
dioxus-core-macro = { path = "./packages/core-macro", version = "^0.1.7", optional = true }
|
||||||
dioxus-hooks = { path = "./packages/hooks", version = "^0.1.7", optional = true }
|
dioxus-hooks = { path = "./packages/hooks", version = "^0.1.7", optional = true }
|
||||||
fermi = { path = "./packages/fermi", version = "^0.1.0", optional = true }
|
fermi = { path = "./packages/fermi", version = "^0.1.0", optional = true }
|
||||||
# dioxus-rsx = { path = "./packages/rsx", optional = true }
|
|
||||||
|
|
||||||
dioxus-web = { path = "./packages/web", version = "^0.0.5", optional = true }
|
dioxus-web = { path = "./packages/web", version = "^0.0.5", optional = true }
|
||||||
dioxus-desktop = { path = "./packages/desktop", version = "^0.1.6", optional = true }
|
dioxus-desktop = { path = "./packages/desktop", version = "^0.1.6", optional = true }
|
||||||
@@ -26,12 +25,15 @@ dioxus-ssr = { path = "./packages/ssr", version = "^0.1.3", optional = true }
|
|||||||
dioxus-router = { path = "./packages/router", version = "^0.1.1", optional = true }
|
dioxus-router = { path = "./packages/router", version = "^0.1.1", optional = true }
|
||||||
dioxus-mobile = { path = "./packages/mobile", version = "^0.0.3", optional = true }
|
dioxus-mobile = { path = "./packages/mobile", version = "^0.0.3", optional = true }
|
||||||
dioxus-interpreter-js = { path = "./packages/interpreter", version = "^0.0.0", optional = true }
|
dioxus-interpreter-js = { path = "./packages/interpreter", version = "^0.0.0", optional = true }
|
||||||
|
dioxus-tui = { path = "./packages/tui", version = "^0.1.0", optional = true }
|
||||||
|
|
||||||
|
# dioxus-rsx = { path = "./packages/rsx", optional = true }
|
||||||
# dioxus-liveview = { path = "./packages/liveview", optional = true }
|
# dioxus-liveview = { path = "./packages/liveview", optional = true }
|
||||||
|
# macro = ["dioxus-core-macro", "dioxus-rsx"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["macro", "hooks", "html"]
|
default = ["macro", "hooks", "html"]
|
||||||
|
|
||||||
# macro = ["dioxus-core-macro", "dioxus-rsx"]
|
|
||||||
macro = ["dioxus-core-macro"]
|
macro = ["dioxus-core-macro"]
|
||||||
hooks = ["dioxus-hooks"]
|
hooks = ["dioxus-hooks"]
|
||||||
html = ["dioxus-html"]
|
html = ["dioxus-html"]
|
||||||
@@ -40,6 +42,8 @@ web = ["dioxus-web", "dioxus-router/web"]
|
|||||||
desktop = ["dioxus-desktop"]
|
desktop = ["dioxus-desktop"]
|
||||||
ayatana = ["dioxus-desktop/ayatana"]
|
ayatana = ["dioxus-desktop/ayatana"]
|
||||||
router = ["dioxus-router"]
|
router = ["dioxus-router"]
|
||||||
|
tui = ["dioxus-tui"]
|
||||||
|
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
@@ -54,6 +58,7 @@ members = [
|
|||||||
"packages/mobile",
|
"packages/mobile",
|
||||||
"packages/interpreter",
|
"packages/interpreter",
|
||||||
"packages/fermi",
|
"packages/fermi",
|
||||||
|
"packages/tui"
|
||||||
]
|
]
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
@@ -68,7 +73,7 @@ serde_json = "1.0.79"
|
|||||||
rand = { version = "0.8.4", features = ["small_rng"] }
|
rand = { version = "0.8.4", features = ["small_rng"] }
|
||||||
tokio = { version = "1.16.1", features = ["full"] }
|
tokio = { version = "1.16.1", features = ["full"] }
|
||||||
reqwest = { version = "0.11.9", features = ["json"] }
|
reqwest = { version = "0.11.9", features = ["json"] }
|
||||||
dioxus = { path = ".", features = ["desktop", "ssr", "router", "fermi"] }
|
dioxus = { path = ".", features = ["desktop", "ssr", "router", "fermi", "tui"] }
|
||||||
fern = { version = "0.6.0", features = ["colored"] }
|
fern = { version = "0.6.0", features = ["colored"] }
|
||||||
criterion = "0.3.5"
|
criterion = "0.3.5"
|
||||||
thiserror = "1.0.30"
|
thiserror = "1.0.30"
|
||||||
|
|||||||
@@ -1,20 +1,23 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rink"
|
name = "dioxus-tui"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tui = "0.17.0"
|
tui = "0.17.0"
|
||||||
crossterm = "0.22.1"
|
crossterm = "0.23.0"
|
||||||
anyhow = "1.0.42"
|
anyhow = "1.0.42"
|
||||||
thiserror = "1.0.24"
|
thiserror = "1.0.24"
|
||||||
dioxus = "0.1.8"
|
dioxus-core = { path = "../core" }
|
||||||
dioxus-html = "0.1.6"
|
dioxus-html = { path = "../html" }
|
||||||
hecs = "0.7.3"
|
hecs = "0.7.3"
|
||||||
ctrlc = "3.2.1"
|
ctrlc = "3.2.1"
|
||||||
bumpalo = { version = "3.8.0", features = ["boxed"] }
|
bumpalo = { version = "3.8.0", features = ["boxed"] }
|
||||||
tokio = { version = "1.15.0", features = ["full"] }
|
tokio = { version = "1.15.0", features = ["full"] }
|
||||||
futures = "0.3.19"
|
futures = "0.3.19"
|
||||||
stretch2 = { git = "https://github.com/DioxusLabs/stretch" }
|
stretch2 = "0.4.0"
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
use crossterm::event::{
|
use crossterm::event::{
|
||||||
Event as TermEvent, KeyCode as TermKeyCode, KeyModifiers, MouseButton, MouseEventKind,
|
Event as TermEvent, KeyCode as TermKeyCode, KeyModifiers, MouseButton, MouseEventKind,
|
||||||
};
|
};
|
||||||
use dioxus::core::*;
|
use dioxus_core::*;
|
||||||
|
|
||||||
use dioxus_html::{on::*, KeyCode};
|
use dioxus_html::{on::*, KeyCode};
|
||||||
use futures::{channel::mpsc::UnboundedReceiver, StreamExt};
|
use futures::{channel::mpsc::UnboundedReceiver, StreamExt};
|
||||||
@@ -146,7 +146,7 @@ impl InnerInputState {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
EventData::Wheel(ref w) => self.wheel = Some(clone_wheel_data(w)),
|
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) => {
|
EventData::Keyboard(ref mut k) => {
|
||||||
let repeat = self
|
let repeat = self
|
||||||
.last_key_pressed
|
.last_key_pressed
|
||||||
@@ -177,7 +177,7 @@ impl InnerInputState {
|
|||||||
wheel_delta: f64,
|
wheel_delta: f64,
|
||||||
mouse_data: &'b MouseData,
|
mouse_data: &'b MouseData,
|
||||||
wheel_data: &'b Option<WheelData>,
|
wheel_data: &'b Option<WheelData>,
|
||||||
};
|
}
|
||||||
|
|
||||||
fn layout_contains_point(layout: &Layout, point: (i32, i32)) -> bool {
|
fn layout_contains_point(layout: &Layout, point: (i32, i32)) -> bool {
|
||||||
layout.location.x as i32 <= point.0
|
layout.location.x as i32 <= point.0
|
||||||
@@ -292,11 +292,9 @@ impl InnerInputState {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else if previously_contained {
|
||||||
if previously_contained {
|
try_create_event("mouseleave");
|
||||||
try_create_event("mouseleave");
|
try_create_event("mouseout");
|
||||||
try_create_event("mouseout");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
events
|
events
|
||||||
}
|
}
|
||||||
@@ -399,7 +397,7 @@ impl RinkInputHandler {
|
|||||||
) -> Vec<UserEvent> {
|
) -> Vec<UserEvent> {
|
||||||
// todo: currently resolves events in all nodes, but once the focus system is added it should filter by focus
|
// todo: currently resolves events in all nodes, but once the focus system is added it should filter by focus
|
||||||
fn inner(
|
fn inner(
|
||||||
queue: &Vec<(&'static str, Arc<dyn Any + Send + Sync>)>,
|
queue: &[(&'static str, Arc<dyn Any + Send + Sync>)],
|
||||||
resolved: &mut Vec<UserEvent>,
|
resolved: &mut Vec<UserEvent>,
|
||||||
node: &VNode,
|
node: &VNode,
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use dioxus::core::*;
|
use dioxus_core::*;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ use crossterm::{
|
|||||||
execute,
|
execute,
|
||||||
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
|
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
|
||||||
};
|
};
|
||||||
use dioxus::core::exports::futures_channel::mpsc::unbounded;
|
use dioxus_core::exports::futures_channel::mpsc::unbounded;
|
||||||
use dioxus::core::*;
|
use dioxus_core::*;
|
||||||
use futures::{channel::mpsc::UnboundedSender, pin_mut, StreamExt};
|
use futures::{channel::mpsc::UnboundedSender, pin_mut, StreamExt};
|
||||||
use std::{
|
use std::{
|
||||||
collections::HashMap,
|
collections::HashMap,
|
||||||
@@ -208,6 +208,8 @@ pub fn render_vdom(
|
|||||||
|
|
||||||
enum InputEvent {
|
enum InputEvent {
|
||||||
UserInput(TermEvent),
|
UserInput(TermEvent),
|
||||||
Close,
|
|
||||||
Tick,
|
Tick,
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
Close,
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
use dioxus::core::*;
|
use dioxus_core::*;
|
||||||
use std::{collections::HashMap, io::Stdout};
|
use std::{collections::HashMap, io::Stdout};
|
||||||
use stretch2::{
|
use stretch2::{
|
||||||
geometry::Point,
|
geometry::Point,
|
||||||
|
|||||||
@@ -435,13 +435,13 @@ impl RinkStyle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<Style> for RinkStyle {
|
impl From<RinkStyle> for Style {
|
||||||
fn into(self) -> Style {
|
fn from(val: RinkStyle) -> Self {
|
||||||
Style {
|
Style {
|
||||||
fg: self.fg.map(|c| c.color),
|
fg: val.fg.map(|c| c.color),
|
||||||
bg: self.bg.map(|c| c.color),
|
bg: val.bg.map(|c| c.color),
|
||||||
add_modifier: self.add_modifier,
|
add_modifier: val.add_modifier,
|
||||||
sub_modifier: self.sub_modifier,
|
sub_modifier: val.sub_modifier,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user