mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-31 01:24:31 +02:00
formatting
This commit is contained in:
parent
027390683f
commit
40a984e137
12
src/lib.rs
12
src/lib.rs
@ -12,9 +12,9 @@ use std::{
|
|||||||
io::{stdout, Stdout, Write},
|
io::{stdout, Stdout, Write},
|
||||||
panic::PanicInfo,
|
panic::PanicInfo,
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
sync::Arc,
|
|
||||||
sync::Condvar,
|
sync::Condvar,
|
||||||
sync::Mutex,
|
sync::Mutex,
|
||||||
|
sync::{mpsc, Arc},
|
||||||
thread,
|
thread,
|
||||||
time::{Duration, Instant},
|
time::{Duration, Instant},
|
||||||
};
|
};
|
||||||
@ -182,7 +182,7 @@ pub fn panic_hook(panic_info: &PanicInfo<'_>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn create_input_thread(
|
pub fn create_input_thread(
|
||||||
sender: std::sync::mpsc::Sender<RuntimeEvent<AppMessages>>,
|
sender: mpsc::Sender<RuntimeEvent<AppMessages>>,
|
||||||
) -> std::thread::JoinHandle<()> {
|
) -> std::thread::JoinHandle<()> {
|
||||||
thread::spawn(move || {
|
thread::spawn(move || {
|
||||||
// TODO: [Optimization, Input] Maybe experiment with removing these timers. Look into using buffers instead?
|
// 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(
|
pub fn create_collection_thread(
|
||||||
sender: std::sync::mpsc::Sender<RuntimeEvent<AppMessages>>,
|
sender: mpsc::Sender<RuntimeEvent<AppMessages>>,
|
||||||
control_receiver: std::sync::mpsc::Receiver<ThreadControlEvent>,
|
control_receiver: mpsc::Receiver<ThreadControlEvent>, termination_ctrl_lock: Arc<Mutex<bool>>,
|
||||||
termination_ctrl_lock: Arc<Mutex<bool>>, termination_ctrl_cvar: Arc<Condvar>,
|
termination_ctrl_cvar: Arc<Condvar>, app_config_fields: &app::AppConfig,
|
||||||
app_config_fields: &app::AppConfig, filters: app::DataFilters, used_widget_set: UsedWidgets,
|
filters: app::DataFilters, used_widget_set: UsedWidgets,
|
||||||
) -> std::thread::JoinHandle<()> {
|
) -> std::thread::JoinHandle<()> {
|
||||||
let temp_type = app_config_fields.temperature_type.clone();
|
let temp_type = app_config_fields.temperature_type.clone();
|
||||||
let use_current_cpu_total = app_config_fields.use_current_cpu_total;
|
let use_current_cpu_total = app_config_fields.use_current_cpu_total;
|
||||||
|
0
src/tuine/component/base/focus.rs
Normal file
0
src/tuine/component/base/focus.rs
Normal file
@ -16,12 +16,21 @@ pub use banner::*;
|
|||||||
use enum_dispatch::enum_dispatch;
|
use enum_dispatch::enum_dispatch;
|
||||||
use tui::Frame;
|
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.
|
/// A component displays information and can be interacted with.
|
||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
#[enum_dispatch]
|
#[enum_dispatch]
|
||||||
pub trait TmpComponent<Message> {
|
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.
|
/// Draws the component.
|
||||||
fn draw<Backend>(
|
fn draw<Backend>(
|
||||||
&mut self, state_ctx: &mut StateContext<'_>, draw_ctx: &DrawContext<'_>,
|
&mut self, state_ctx: &mut StateContext<'_>, draw_ctx: &DrawContext<'_>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user