From a686ed7d527a2b2923632fa0eff17039150b121f Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 1 May 2026 06:32:15 -0500 Subject: [PATCH] [fix]: a lot more custom icons and learing how cfg! works --- res/edit.svg | 1 + res/presentation-analytics.svg | 1 + src/main.rs | 25 ++++++++++++++++++++----- 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 res/edit.svg create mode 100644 res/presentation-analytics.svg diff --git a/res/edit.svg b/res/edit.svg new file mode 100644 index 0000000..02d393d --- /dev/null +++ b/res/edit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/res/presentation-analytics.svg b/res/presentation-analytics.svg new file mode 100644 index 0000000..5361c01 --- /dev/null +++ b/res/presentation-analytics.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index eef9eeb..c6030c3 100755 --- a/src/main.rs +++ b/src/main.rs @@ -535,9 +535,15 @@ impl cosmic::Application for App { tooltip( button::custom( row!( - Container::new( - icon::from_name("document-edit-symbolic").scale(3) - ) + Container::new(if self.editor_mode.is_some() { + icon::from_path("./res/presentation-analytics.svg".into()) + .symbolic(true) + .apply(icon::icon) + } else { + icon::from_path("./res/edit.svg".into()) + .symbolic(true) + .apply(icon::icon) + }) .center_y(Length::Fill), text::body(if self.editor_mode.is_some() { "Present Mode" @@ -556,14 +562,23 @@ impl cosmic::Application for App { tooltip( button::custom( row!( - Container::new( + Container::new(if cfg!(target_os = "linux") { icon::from_name(if self.presentation_open { "window-close-symbolic" } else { "view-presentation-symbolic" }) .scale(3) - ) + .icon() + } else { + if self.presentation_open { + icon::from_name("window-close-symbolic").scale(3).icon() + } else { + icon::from_path("./res/presentation-analytics.svg".into()) + .symbolic(true) + .apply(icon::icon) + } + }) .center_y(Length::Fill), text )