diff --git a/src/app.rs b/src/app.rs index 3c6e865..9277566 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1,5 +1,5 @@ use eframe::egui::{ - Align, Button, CentralPanel, Color32, ComboBox, Context, FontId, Grid, Image, Layout, Rect, Spinner, TextStyle, + Align, Button, CentralPanel, ComboBox, Context, FontId, Grid, Image, Layout, Rect, Spinner, TextStyle, TopBottomPanel, }; use std::path::PathBuf; @@ -214,13 +214,13 @@ impl eframe::App for App { self.hook_metadata.manifest.checksum == 0, self.hook_metadata.vec_manifests.len() == 0, ) { - (_, _, true, true) => (format!("✖ {}", t!("hook data was not loaded")), Color32::LIGHT_RED), + (_, _, true, true) => (format!("✖ {}", t!("hook data was not loaded")), COLOR_ERROR), (false, _, _, _) => ( format!("✖ {}", t!("this DF version is not supported")), - Color32::LIGHT_RED, + COLOR_ERROR, ), - (true, true, _, _) => (format!("✅ {}", t!("up-to-date")), Color32::LIGHT_GREEN), - (true, false, _, _) => (format!("⚠ {}", t!("update available")), Color32::from_rgb(255, 255, 90)), + (true, true, _, _) => (format!("✅ {}", t!("up-to-date")), COLOR_UP_TO_DATE), + (true, false, _, _) => (format!("⚠ {}", t!("update available")), COLOR_UPDATE_AVAILABLE), }; ui.colored_label(color, text); @@ -272,11 +272,11 @@ impl eframe::App for App { ) { (_, _, true) => ( format!("✖ {}", t!("dictionary data was not loaded")), - Color32::LIGHT_RED, + COLOR_ERROR, ), - (true, false, false) => (format!("✅ {}", t!("up-to-date")), Color32::LIGHT_GREEN), - (false, false, false) => (format!("⚠ {}", t!("update available")), Color32::from_rgb(255, 255, 90)), - (_, true, false) => (format!("⚠ {}", t!("choose language")), Color32::from_rgb(255, 255, 90)), + (true, false, false) => (format!("✅ {}", t!("up-to-date")), COLOR_UP_TO_DATE), + (false, false, false) => (format!("⚠ {}", t!("update available")), COLOR_UPDATE_AVAILABLE), + (_, true, false) => (format!("⚠ {}", t!("choose language")), COLOR_CHOOSE_LANGUAGE), }; ui.colored_label(color, text); ui.end_row(); diff --git a/src/constants.rs b/src/constants.rs index 595fa9a..3214e77 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -1,3 +1,5 @@ +use eframe::egui::Color32; + pub const VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub const GITHUB_ICON: eframe::egui::widgets::ImageSource<'static> = @@ -22,3 +24,8 @@ pub const PATH_OFFSETS: &'static str = "dfint-data/offsets.toml"; pub const PATH_DICT: &'static str = "dfint-data/dictionary.csv"; pub const PATH_FONT: &'static str = "data/art/curses_640x300.png"; pub const PATH_ENCODING: &'static str = "dfint-data/encoding.toml"; + +pub const COLOR_UP_TO_DATE: Color32 = Color32::from_rgb(67, 160, 71); +pub const COLOR_UPDATE_AVAILABLE: Color32 = Color32::from_rgb(230, 184, 0); +pub const COLOR_CHOOSE_LANGUAGE: Color32 = Color32::from_rgb(230, 184, 0); +pub const COLOR_ERROR: Color32 = Color32::from_rgb(211, 47, 47); diff --git a/src/main.rs b/src/main.rs index a9b2cd9..0e5969c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,6 +6,7 @@ extern crate serde_derive; use anyhow::Result; use constants::APP_ICON; use eframe::egui; +// use eframe::egui::{Style, Visuals}; mod app; mod constants; @@ -31,6 +32,11 @@ fn main() -> Result<(), eframe::Error> { "DF localization installer", options, Box::new(|cc| { + // let style = Style { + // visuals: Visuals::light(), + // ..Style::default() + // }; + // cc.egui_ctx.set_style(style); egui_extras::install_image_loaders(&cc.egui_ctx); Box::::default() }),