diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index db4bab2..cd8f6c2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,6 +28,10 @@ jobs: name: windows arch: x86_64 target: x86_64-pc-windows-msvc + - os: windows-latest + name: windows + arch: aarch64 + target: aarch64-pc-windows-msvc # MacOS - os: macos-latest name: macos diff --git a/Cargo.toml b/Cargo.toml index 3b006ef..2b8fc07 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,6 @@ [workspace] resolver = "2" members = [ - "crates/catppuccin-egui", "crates/egui-dock", "crates/egui-term", "crates/egui-theme-switch", @@ -23,7 +22,7 @@ keywords = ["terminal", "egui"] [workspace.dependencies] alacritty_terminal = { git = "https://github.com/alacritty/alacritty" } anyhow = "1" -catppuccin-egui = { git = "https://github.com/iamazy/catppuccin-egui", branch = "egui30" } +catppuccin-egui = { version = "5.5", default-features = false } chrono = "0.4" copypasta = "0.10" duplicate = "2" diff --git a/crates/catppuccin-egui/Cargo.toml b/crates/catppuccin-egui/Cargo.toml deleted file mode 100644 index 15adb2c..0000000 --- a/crates/catppuccin-egui/Cargo.toml +++ /dev/null @@ -1,20 +0,0 @@ -[package] -name = "catppuccin-egui" -version = "5.3.1" -authors = ["Sam Nystrom "] -edition = "2021" -description = "Soothing pastel theme for egui." -documentation = "https://docs.rs/catppuccin-egui/" -readme = "README.md" -homepage = "https://github.com/catppuccin/egui" -repository = "https://github.com/catppuccin/egui" -license = "MIT" -keywords = ["egui", "catppuccin", "theme", "gui"] -categories = ["gui"] -exclude = ["assets/", "src/themes.rs.tera"] - -[dependencies] -egui.workspace = true - -[dev-dependencies] -eframe.workspace = true diff --git a/crates/catppuccin-egui/build.rs b/crates/catppuccin-egui/build.rs deleted file mode 100644 index 8ab872f..0000000 --- a/crates/catppuccin-egui/build.rs +++ /dev/null @@ -1,37 +0,0 @@ -use std::{ - fs, - path::Path, - process::{Command, ExitCode}, -}; - -fn main() -> ExitCode { - println!("cargo::rerun-if-changed=src/themes.rs.tera"); - - // src/themes.rs.tera is excluded from the distributed crate so whiskers is - // not run if the crate is used as a dependency. - if !Path::new("src/themes.rs.tera").exists() { - return ExitCode::SUCCESS; - } - - let outfile = fs::OpenOptions::new() - .write(true) - .create(true) - .truncate(true) - .open("src/themes.rs") - .unwrap(); - - let Ok(stat) = Command::new("whiskers") - .arg("src/themes.rs.tera") - .stdout(outfile) - .status() - else { - println!("cargo::warning=Failed to run whiskers (https://github.com/catppuccin/toolbox/tree/main/whiskers). Is it installed?"); - return ExitCode::SUCCESS; - }; - - if !stat.success() { - println!("cargo::warning=whiskers exited nonzero"); - return ExitCode::FAILURE; - } - ExitCode::SUCCESS -} diff --git a/crates/catppuccin-egui/src/lib.rs b/crates/catppuccin-egui/src/lib.rs deleted file mode 100644 index 0f3d79d..0000000 --- a/crates/catppuccin-egui/src/lib.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Soothing pastel theme for [egui](egui). -//! -//! To use, call [`set_theme`](crate::set_theme) with the egui context -//! and a [`Theme`](crate::Theme). -//! -//! # Example -//! -//! ```rust -//! # use eframe::egui; -//! struct App; -//! impl eframe::App for App { -//! fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { -//! catppuccin_egui::set_theme(ctx, catppuccin_egui::MACCHIATO); -//! egui::CentralPanel::default().show(&ctx, |ui| { -//! ui.label("Hello, world!"); -//! }); -//! } -//! } -//! ``` -//! -//! You can also customize your own theme: -//! -//! ```rust -//! # use eframe::egui; -//! use catppuccin_egui::{Theme, MOCHA}; -//! const MY_MOCHA: Theme = Theme { -//! red: egui::Color32::from_rgb(255, 0, 0), -//! ..MOCHA -//! }; -//! ``` -//! - -use egui::{epaint, style}; - -mod themes; -pub use themes::*; - -/// Apply the given theme to a [`Context`](egui::Context). -pub fn set_theme(ctx: &egui::Context, theme: Theme) { - let old = ctx.style().visuals.clone(); - ctx.set_visuals(theme.visuals(old)); -} - -/// Apply the given theme to a [`Style`](egui::Style). -/// -/// # Example -/// -/// ```rust -/// # use eframe::egui; -/// # use egui::__run_test_ctx; -/// # __run_test_ctx(|ctx| { -/// let mut style = (*ctx.style()).clone(); -/// catppuccin_egui::set_style_theme(&mut style, catppuccin_egui::MACCHIATO); -/// ctx.set_style(style); -/// # }); -/// ``` -pub fn set_style_theme(style: &mut egui::Style, theme: Theme) { - let old = style.visuals.clone(); - style.visuals = theme.visuals(old); -} - -fn make_widget_visual( - old: style::WidgetVisuals, - theme: &Theme, - bg_fill: egui::Color32, -) -> style::WidgetVisuals { - style::WidgetVisuals { - bg_fill, - weak_bg_fill: bg_fill, - bg_stroke: egui::Stroke { - color: theme.overlay1, - ..old.bg_stroke - }, - fg_stroke: egui::Stroke { - color: theme.text, - ..old.fg_stroke - }, - ..old - } -} - -impl Theme { - fn visuals(&self, old: egui::Visuals) -> egui::Visuals { - let is_latte = *self == LATTE; - let shadow_color = if is_latte { - egui::Color32::from_black_alpha(25) - } else { - egui::Color32::from_black_alpha(96) - }; - - egui::Visuals { - override_text_color: Some(self.text), - hyperlink_color: self.rosewater, - faint_bg_color: self.surface0, - extreme_bg_color: self.crust, - code_bg_color: self.mantle, - warn_fg_color: self.peach, - error_fg_color: self.maroon, - window_fill: self.base, - panel_fill: self.base, - window_stroke: egui::Stroke { - color: self.overlay1, - ..old.window_stroke - }, - widgets: style::Widgets { - noninteractive: make_widget_visual(old.widgets.noninteractive, self, self.base), - inactive: make_widget_visual(old.widgets.inactive, self, self.surface0), - hovered: make_widget_visual(old.widgets.hovered, self, self.surface2), - active: make_widget_visual(old.widgets.active, self, self.surface1), - open: make_widget_visual(old.widgets.open, self, self.surface0), - }, - selection: style::Selection { - bg_fill: self.blue.linear_multiply(if is_latte { 0.4 } else { 0.2 }), - stroke: egui::Stroke { - color: self.overlay1, - ..old.selection.stroke - }, - }, - - window_shadow: epaint::Shadow { - color: shadow_color, - ..old.window_shadow - }, - popup_shadow: epaint::Shadow { - color: shadow_color, - ..old.popup_shadow - }, - dark_mode: !is_latte, - ..old - } - } -} diff --git a/crates/catppuccin-egui/src/themes.rs b/crates/catppuccin-egui/src/themes.rs deleted file mode 100644 index 9a66706..0000000 --- a/crates/catppuccin-egui/src/themes.rs +++ /dev/null @@ -1,148 +0,0 @@ -use egui::Color32; - -/// The colors for a theme variant. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)] -pub struct Theme { - pub rosewater: Color32, - pub flamingo: Color32, - pub pink: Color32, - pub mauve: Color32, - pub red: Color32, - pub maroon: Color32, - pub peach: Color32, - pub yellow: Color32, - pub green: Color32, - pub teal: Color32, - pub sky: Color32, - pub sapphire: Color32, - pub blue: Color32, - pub lavender: Color32, - pub text: Color32, - pub subtext1: Color32, - pub subtext0: Color32, - pub overlay2: Color32, - pub overlay1: Color32, - pub overlay0: Color32, - pub surface2: Color32, - pub surface1: Color32, - pub surface0: Color32, - pub base: Color32, - pub mantle: Color32, - pub crust: Color32, -} - -pub const LATTE: Theme = Theme { - rosewater: Color32::from_rgb(220, 138, 120), - flamingo: Color32::from_rgb(221, 120, 120), - pink: Color32::from_rgb(234, 118, 203), - mauve: Color32::from_rgb(136, 57, 239), - red: Color32::from_rgb(210, 15, 57), - maroon: Color32::from_rgb(230, 69, 83), - peach: Color32::from_rgb(254, 100, 11), - yellow: Color32::from_rgb(223, 142, 29), - green: Color32::from_rgb(64, 160, 43), - teal: Color32::from_rgb(23, 146, 153), - sky: Color32::from_rgb(4, 165, 229), - sapphire: Color32::from_rgb(32, 159, 181), - blue: Color32::from_rgb(30, 102, 245), - lavender: Color32::from_rgb(114, 135, 253), - text: Color32::from_rgb(76, 79, 105), - subtext1: Color32::from_rgb(92, 95, 119), - subtext0: Color32::from_rgb(108, 111, 133), - overlay2: Color32::from_rgb(124, 127, 147), - overlay1: Color32::from_rgb(140, 143, 161), - overlay0: Color32::from_rgb(156, 160, 176), - surface2: Color32::from_rgb(172, 176, 190), - surface1: Color32::from_rgb(188, 192, 204), - surface0: Color32::from_rgb(204, 208, 218), - base: Color32::from_rgb(239, 241, 245), - mantle: Color32::from_rgb(230, 233, 239), - crust: Color32::from_rgb(220, 224, 232), -}; - -pub const FRAPPE: Theme = Theme { - rosewater: Color32::from_rgb(242, 213, 207), - flamingo: Color32::from_rgb(238, 190, 190), - pink: Color32::from_rgb(244, 184, 228), - mauve: Color32::from_rgb(202, 158, 230), - red: Color32::from_rgb(231, 130, 132), - maroon: Color32::from_rgb(234, 153, 156), - peach: Color32::from_rgb(239, 159, 118), - yellow: Color32::from_rgb(229, 200, 144), - green: Color32::from_rgb(166, 209, 137), - teal: Color32::from_rgb(129, 200, 190), - sky: Color32::from_rgb(153, 209, 219), - sapphire: Color32::from_rgb(133, 193, 220), - blue: Color32::from_rgb(140, 170, 238), - lavender: Color32::from_rgb(186, 187, 241), - text: Color32::from_rgb(198, 208, 245), - subtext1: Color32::from_rgb(181, 191, 226), - subtext0: Color32::from_rgb(165, 173, 206), - overlay2: Color32::from_rgb(148, 156, 187), - overlay1: Color32::from_rgb(131, 139, 167), - overlay0: Color32::from_rgb(115, 121, 148), - surface2: Color32::from_rgb(98, 104, 128), - surface1: Color32::from_rgb(81, 87, 109), - surface0: Color32::from_rgb(65, 69, 89), - base: Color32::from_rgb(48, 52, 70), - mantle: Color32::from_rgb(41, 44, 60), - crust: Color32::from_rgb(35, 38, 52), -}; - -pub const MACCHIATO: Theme = Theme { - rosewater: Color32::from_rgb(244, 219, 214), - flamingo: Color32::from_rgb(240, 198, 198), - pink: Color32::from_rgb(245, 189, 230), - mauve: Color32::from_rgb(198, 160, 246), - red: Color32::from_rgb(237, 135, 150), - maroon: Color32::from_rgb(238, 153, 160), - peach: Color32::from_rgb(245, 169, 127), - yellow: Color32::from_rgb(238, 212, 159), - green: Color32::from_rgb(166, 218, 149), - teal: Color32::from_rgb(139, 213, 202), - sky: Color32::from_rgb(145, 215, 227), - sapphire: Color32::from_rgb(125, 196, 228), - blue: Color32::from_rgb(138, 173, 244), - lavender: Color32::from_rgb(183, 189, 248), - text: Color32::from_rgb(202, 211, 245), - subtext1: Color32::from_rgb(184, 192, 224), - subtext0: Color32::from_rgb(165, 173, 203), - overlay2: Color32::from_rgb(147, 154, 183), - overlay1: Color32::from_rgb(128, 135, 162), - overlay0: Color32::from_rgb(110, 115, 141), - surface2: Color32::from_rgb(91, 96, 120), - surface1: Color32::from_rgb(73, 77, 100), - surface0: Color32::from_rgb(54, 58, 79), - base: Color32::from_rgb(36, 39, 58), - mantle: Color32::from_rgb(30, 32, 48), - crust: Color32::from_rgb(24, 25, 38), -}; - -pub const MOCHA: Theme = Theme { - rosewater: Color32::from_rgb(245, 224, 220), - flamingo: Color32::from_rgb(242, 205, 205), - pink: Color32::from_rgb(245, 194, 231), - mauve: Color32::from_rgb(203, 166, 247), - red: Color32::from_rgb(243, 139, 168), - maroon: Color32::from_rgb(235, 160, 172), - peach: Color32::from_rgb(250, 179, 135), - yellow: Color32::from_rgb(249, 226, 175), - green: Color32::from_rgb(166, 227, 161), - teal: Color32::from_rgb(148, 226, 213), - sky: Color32::from_rgb(137, 220, 235), - sapphire: Color32::from_rgb(116, 199, 236), - blue: Color32::from_rgb(137, 180, 250), - lavender: Color32::from_rgb(180, 190, 254), - text: Color32::from_rgb(205, 214, 244), - subtext1: Color32::from_rgb(186, 194, 222), - subtext0: Color32::from_rgb(166, 173, 200), - overlay2: Color32::from_rgb(147, 153, 178), - overlay1: Color32::from_rgb(127, 132, 156), - overlay0: Color32::from_rgb(108, 112, 134), - surface2: Color32::from_rgb(88, 91, 112), - surface1: Color32::from_rgb(69, 71, 90), - surface0: Color32::from_rgb(49, 50, 68), - base: Color32::from_rgb(30, 30, 46), - mantle: Color32::from_rgb(24, 24, 37), - crust: Color32::from_rgb(17, 17, 27), -}; diff --git a/crates/catppuccin-egui/src/themes.rs.tera b/crates/catppuccin-egui/src/themes.rs.tera deleted file mode 100644 index 3529dff..0000000 --- a/crates/catppuccin-egui/src/themes.rs.tera +++ /dev/null @@ -1,20 +0,0 @@ ---- -whiskers: - version: 2.5.1 ---- -use egui::Color32; - -/// The colors for a theme variant. -#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)] -pub struct Theme { - {%- for name, _ in flavors.latte.colors %} - pub {{name}}: Color32, - {%- endfor %} -} -{% for id, flavor in flavors %} -pub const {{id | upper}}: Theme = Theme { - {%- for name, color in flavor.colors %} - {{name}}: Color32::from_rgb({{color.rgb.r}}, {{color.rgb.g}}, {{color.rgb.b}}), - {%- endfor %} -}; -{% endfor %} diff --git a/nxshell/Cargo.toml b/nxshell/Cargo.toml index 24f29da..f56db08 100644 --- a/nxshell/Cargo.toml +++ b/nxshell/Cargo.toml @@ -11,15 +11,15 @@ categories.workspace = true keywords.workspace = true [dependencies] -catppuccin-egui = { path = "../crates/catppuccin-egui" } +catppuccin-egui = { workspace = true, features = ["egui31"] } chrono.workspace = true copypasta.workspace = true egui.workspace = true eframe = { workspace = true, features = [ - "accesskit", # Make egui compatible with screen readers. NOTE: adds a lot of dependencies. + "accesskit", # Make egui compatible with screen readers. NOTE: adds a lot of dependencies. "default_fonts", # Embed the default egui fonts. - "wgpu", # Use the glow rendering backend. Alternative: "wgpu". - "persistence", # Enable restoring app state when restarting the app. + "wgpu", # Use the glow rendering backend. Alternative: "wgpu". + "persistence", # Enable restoring app state when restarting the app. ] } egui-term = { path = "../crates/egui-term" } egui_dock = { path = "../crates/egui-dock" }