refactor: move around some configuration code again (#1371)

This commit is contained in:
Clement Tsang 2024-01-01 22:39:10 +00:00 committed by GitHub
parent 228da99489
commit c242b4aff3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 1155 additions and 1153 deletions

View file

@ -20,7 +20,7 @@ use bottom::{
create_or_get_config, create_or_get_config,
data_conversion::*, data_conversion::*,
handle_key_event_or_break, handle_mouse_event, handle_key_event_or_break, handle_mouse_event,
options::config::{get_color_scheme, get_widget_layout, init_app}, options::{get_color_scheme, get_widget_layout, init_app},
panic_hook, read_config, try_drawing, update_data, BottomEvent, panic_hook, read_config, try_drawing, update_data, BottomEvent,
}; };
use crossterm::{ use crossterm::{

View file

@ -5,7 +5,7 @@ use tui::style::{Color, Style};
use super::ColourScheme; use super::ColourScheme;
use crate::{ use crate::{
constants::*, constants::*,
options::config::{Config, ConfigColours}, options::{Config, ConfigColours},
utils::error, utils::error,
}; };
mod colour_utils; mod colour_utils;
@ -238,7 +238,7 @@ mod test {
use tui::style::{Color, Style}; use tui::style::{Color, Style};
use super::{CanvasStyling, ColourScheme}; use super::{CanvasStyling, ColourScheme};
use crate::Config; use crate::options::Config;
#[test] #[test]
fn default_selected_colour_works() { fn default_selected_colour_works() {

View file

@ -1,6 +1,6 @@
use tui::widgets::Borders; use tui::widgets::Borders;
use crate::options::config::ConfigColours; use crate::options::ConfigColours;
// Default widget ID // Default widget ID
pub const DEFAULT_WIDGET_ID: u64 = 56709; pub const DEFAULT_WIDGET_ID: u64 = 56709;

View file

@ -60,7 +60,7 @@ use crossterm::{
}; };
use data_conversion::*; use data_conversion::*;
pub use options::args; pub use options::args;
use options::config::Config; use options::Config;
use utils::error; use utils::error;
#[allow(unused_imports)] #[allow(unused_imports)]
pub use utils::logging::*; pub use utils::logging::*;

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -15,7 +15,7 @@ use crate::{
}, },
data_collection::cpu::CpuDataType, data_collection::cpu::CpuDataType,
data_conversion::CpuWidgetData, data_conversion::CpuWidgetData,
options::config::CpuDefault, options::config::cpu::CpuDefault,
utils::general::truncate_to_text, utils::general::truncate_to_text,
}; };

View file

@ -5,7 +5,7 @@ use bottom::constants::DEFAULT_BATTERY_LAYOUT;
use bottom::{ use bottom::{
app::layout_manager::{BottomLayout, BottomWidgetType}, app::layout_manager::{BottomLayout, BottomWidgetType},
constants::{DEFAULT_LAYOUT, DEFAULT_WIDGET_ID}, constants::{DEFAULT_LAYOUT, DEFAULT_WIDGET_ID},
options::config::{layout::Row, Config}, options::{config::layout::Row, Config},
utils::error, utils::error,
}; };
use toml_edit::de::from_str; use toml_edit::de::from_str;