Skip to content

Commit

Permalink
Update to Iced 0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chanderlud committed Aug 13, 2023
1 parent 213a43c commit ff5d6db
Show file tree
Hide file tree
Showing 19 changed files with 1,115 additions and 819 deletions.
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ build = "build.rs"
[dependencies]
serde_json = "1.0.81"
tokio = { version = "1.18.2", default-features = false, features = ["rt", "rt-multi-thread", "time", "sync"] }
iced = { version = "0.9.0", features = ["tokio"] }
iced_style = "*"
iced = { version = "0.10.0", features = ["tokio"] }
dark-light = "1.0.0"
plotters = { version = "0.3.0", default-features = false, features = ["line_series", "datetime", "deprecated_items", "area_series"]}
plotters-iced = "0.8.0"
plotters-iced = "0.9.0"
plotters-backend = "0.3.0"
image = { version = "0.24.2", default-features = false, features = ["ico"] }
serde = { version = "1.0.160", features = ["derive"] }
Expand Down
7 changes: 2 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
use std::env;
use std::path::PathBuf;

use bindgen;
use embed_resource;
use winres;

fn main() {
println!("cargo:rustc-link-search=native=LibreHardwareMonitorAPI\\x64\\Release");
println!("cargo:rustc-link-lib=dylib=ManagedLibreHardwareMonitorWrapper");
Expand All @@ -26,5 +22,6 @@ fn main() {

winres::WindowsResource::new()
.set_icon("icon.ico")
.compile().expect("failed to add icon to executable");
.compile()
.expect("failed to add icon to executable");
}
6 changes: 3 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl Display for Error {
pub(crate) struct Config {
pub(crate) theme: Theme,
pub(crate) celsius: bool,
pub(crate) visibility: HashMap<String, bool>
pub(crate) visibility: HashMap<String, bool>,
}

// default options
Expand All @@ -55,7 +55,7 @@ impl Default for Config {
Self {
theme: Theme::System,
celsius: true,
visibility: Default::default()
visibility: Default::default(),
}
}
}
Expand Down Expand Up @@ -85,7 +85,7 @@ impl Config {
// save config to file
pub(crate) fn save(&self) -> Result<()> {
let path = Path::new("config.json");
let file = File::create(path).unwrap();
let file = File::create(path)?;
serde_json::to_writer_pretty(file, self)?;
Ok(())
}
Expand Down
6 changes: 2 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// disables console for non debug builds only
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
Expand All @@ -13,12 +12,11 @@ compile_error!("This application only supports Windows.");

include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

mod ui;
mod system;
mod config;
mod system;
mod ui;

// TODO optional stats, dont render them if they arent available
// TODO scrollable is crashing shit i think (github issue)
fn main() {
if let Err(error) = ui::main() {
println!("An error occurred: {:?}", error);
Expand Down
Loading

0 comments on commit ff5d6db

Please sign in to comment.