From 2fcdf43f44f1d9da52575695bc88bd6441db78d2 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Thu, 24 Sep 2026 23:57:20 +0300 Subject: [PATCH] fix(ribbon): follow-ups to the Reference panel merge - The palette launcher arrow is recoloured from the theme like the other interface icons, instead of drawing the raw SVG. - The Frames dropdown shares one icon constant; its entries were left misindented. Co-Authored-By: Claude Opus 5.5 --- src/modules/insert/mod.rs | 19 +++++++------------ src/ui/ribbon/draw_panel.rs | 19 +++++++++++-------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/modules/insert/mod.rs b/src/modules/insert/mod.rs index 27c9d92d6..610f48934 100644 --- a/src/modules/insert/mod.rs +++ b/src/modules/insert/mod.rs @@ -30,6 +30,9 @@ pub(crate) mod xclip; use crate::modules::{CadModule, IconKind, RibbonGroup, RibbonItem}; +const FRAMES_ICON: IconKind = + IconKind::Svg(include_bytes!("../../../assets/icons/underlay_frames.svg")); + pub struct InsertModule; impl CadModule for InsertModule { @@ -56,19 +59,11 @@ impl CadModule for InsertModule { RibbonItem::LabeledDropdown { id: "FRAMES_DROPDOWN", label: "", - icon: IconKind::Svg(include_bytes!( - "../../../assets/icons/underlay_frames.svg" - )), + icon: FRAMES_ICON, items: vec![ - ("FRAMES0", "Frames Off", IconKind::Svg(include_bytes!( - "../../../assets/icons/underlay_frames.svg" - ))), - ("FRAMES1", "Frames On", IconKind::Svg(include_bytes!( - "../../../assets/icons/underlay_frames.svg" - ))), - ("FRAMES2", "Frames On, Not Plotted", IconKind::Svg(include_bytes!( - "../../../assets/icons/underlay_frames.svg" - ))), + ("FRAMES0", "Frames Off", FRAMES_ICON), + ("FRAMES1", "Frames On", FRAMES_ICON), + ("FRAMES2", "Frames On, Not Plotted", FRAMES_ICON), ], default: "FRAMES1", }, diff --git a/src/ui/ribbon/draw_panel.rs b/src/ui/ribbon/draw_panel.rs index 787777917..8ad7d7eaa 100644 --- a/src/ui/ribbon/draw_panel.rs +++ b/src/ui/ribbon/draw_panel.rs @@ -206,17 +206,20 @@ pub(super) fn group_title<'a>(title: &'static str, open: &Option) -> Ele let launcher = tooltip( // A right arrow turned to point into the corner. button( - iced::widget::svg(iced::widget::svg::Handle::from_memory(icons::ARROW_LONG_RIGHT)) + iced::widget::svg(icons::themed_handle(icons::ARROW_LONG_RIGHT)) .width(10) .height(10) - .rotation(iced::Radians(std::f32::consts::FRAC_PI_4)), + .rotation(iced::Radians(std::f32::consts::FRAC_PI_4)) + .style(|theme: &Theme, _| iced::widget::svg::Style { + color: Some(theme.palette().background.base.text), + }), ) - .on_press(Message::RibbonToolClick { - tool_id: "EXTERNALREFERENCES".to_string(), - event: crate::modules::ModuleEvent::Command("EXTERNALREFERENCES".to_string()), - }) - .style(move |theme: &Theme, status| tool_btn_style(theme, false, status)) - .padding([0, 3]), + .on_press(Message::RibbonToolClick { + tool_id: "EXTERNALREFERENCES".to_string(), + event: crate::modules::ModuleEvent::Command("EXTERNALREFERENCES".to_string()), + }) + .style(move |theme: &Theme, status| tool_btn_style(theme, false, status)) + .padding([0, 3]), make_tip(format!("{}\n{} EXTERNALREFERENCES", t!("External References"), t!("Command:"))), tooltip::Position::Bottom, )