summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClementTsang <cjhtsang@uwaterloo.ca>2022-01-01 21:42:57 -0500
committerClementTsang <cjhtsang@uwaterloo.ca>2022-01-02 17:49:57 -0500
commit40a984e137b1bdde0cc6d2d316c15f133a9e0624 (patch)
tree5daec57f4d545d78ef396134f4e36f5e710fd00b
parent027390683ffefa28ac4ad7a6f3b2051a1c56065d (diff)
formatting
-rw-r--r--src/lib.rs12
-rw-r--r--src/tuine/component/base/focus.rs0
-rw-r--r--src/tuine/component/mod.rs11
3 files changed, 16 insertions, 7 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 2ca9b369..2559eb34 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -12,9 +12,9 @@ use std::{
io::{stdout, Stdout, Write},
panic::PanicInfo,
path::PathBuf,
- sync::Arc,
sync::Condvar,
sync::Mutex,
+ sync::{mpsc, Arc},
thread,
time::{Duration, Instant},
};
@@ -182,7 +182,7 @@ pub fn panic_hook(panic_info: &PanicInfo<'_>) {
}
pub fn create_input_thread(
- sender: std::sync::mpsc::Sender<RuntimeEvent<AppMessages>>,
+ sender: mpsc::Sender<RuntimeEvent<AppMessages>>,
) -> std::thread::JoinHandle<()> {
thread::spawn(move || {
// TODO: [Optimization, Input] Maybe experiment with removing these timers. Look into using buffers instead?
@@ -230,10 +230,10 @@ pub fn create_input_thread(
}
pub fn create_collection_thread(
- sender: std::sync::mpsc::Sender<RuntimeEvent<AppMessages>>,
- control_receiver: std::sync::mpsc::Receiver<ThreadControlEvent>,
- termination_ctrl_lock: Arc<Mutex<bool>>, termination_ctrl_cvar: Arc<Condvar>,
- app_config_fields: &app::AppConfig, filters: app::DataFilters, used_widget_set: UsedWidgets,
+ sender: mpsc::Sender<RuntimeEvent<AppMessages>>,
+ control_receiver: mpsc::Receiver<ThreadControlEvent>, termination_ctrl_lock: Arc<Mutex<bool>>,
+ termination_ctrl_cvar: Arc<Condvar>, app_config_fields: &app::AppConfig,
+ filters: app::DataFilters, used_widget_set: UsedWidgets,
) -> std::thread::JoinHandle<()> {
let temp_type = app_config_fields.temperature_type.clone();
let use_current_cpu_total = app_config_fields.use_current_cpu_total;
diff --git a/src/tuine/component/base/focus.rs b/src/tuine/component/base/focus.rs
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/tuine/component/base/focus.rs
diff --git a/src/tuine/component/mod.rs b/src/tuine/component/mod.rs
index aaea0f32..90713c5e 100644
--- a/src/tuine/component/mod.rs
+++ b/src/tuine/component/mod.rs
@@ -16,12 +16,21 @@ pub use banner::*;
use enum_dispatch::enum_dispatch;
use tui::Frame;
-use super::{Bounds, DrawContext, Event, LayoutNode, Size, StateContext, Status};
+use super::{Bounds, DrawContext, Element, Event, LayoutNode, Size, StateContext, Status};
/// A component displays information and can be interacted with.
#[allow(unused_variables)]
#[enum_dispatch]
pub trait TmpComponent<Message> {
+ /// Builds as component into an [`Element`](super::Element).
+ #[track_caller]
+ fn build(self, ctx: ()) -> Element<Message>
+ where
+ Self: Sized,
+ {
+ todo!()
+ }
+
/// Draws the component.
fn draw<Backend>(
&mut self, state_ctx: &mut StateContext<'_>, draw_ctx: &DrawContext<'_>,