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 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-09-24 23:57:20 +03:00
1 parent 0ea8599f86
commit 2fcdf43f44
2 files changed
+18 -20

No files matched your search

+7 -12
View File
@@ -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",
},
+11 -8
View File
@@ -206,17 +206,20 @@ pub(super) fn group_title<'a>(title: &'static str, open: &Option<String>) -> 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,
)