Key tips: reference command for shared codes, no code over labels

A code the reference shows on two buttons runs the button whose command
the reference runs for it (VC runs Viewport Configuration), decided by
the code table's order. Labels, combo values and panel titles report
their bounds while key tips are open, and each code takes the first
spot nearest the reference place that covers none of them nor another
code; a collapsed panel's title is measured to place its code beside
the words.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-10-14 15:17:38 +03:00
1 parent b5ce285386
commit c2c34e45fa
4 files changed
+270 -97

No files matched your search

+20 -12
View File
@@ -979,6 +979,8 @@ impl Ribbon {
color: (!is_current || disabled)
.then_some(theme.palette().background.base.text.scale_alpha(0.72)),
});
let label_el =
keytips::label_anchor(|| keytips::label_id(&keytips::item_anchor(dd_id, cmd)), label_el);
let item = button(
row![checkmark, icon_el, label_el]
@@ -1560,12 +1562,15 @@ fn collapse_button<'a>(
column![
icon,
row![
text(localized_title.clone())
.size(9)
.width(Fill)
.align_x(iced::Center)
.wrapping(iced::advanced::text::Wrapping::Word)
.style(muted_text_style),
keytips::label_anchor(
|| keytips::label_id(&keytips::collapsed_anchor(title)),
text(localized_title.clone())
.size(9)
.width(Fill)
.align_x(iced::Center)
.wrapping(iced::advanced::text::Wrapping::Word)
.style(muted_text_style),
),
crate::ui::icons::themed_secondary_arrow_down(8.0),
]
.spacing(3)
@@ -1632,12 +1637,15 @@ fn collapse_button<'a>(
let opener = button(
row![
text(localized_title.clone())
.size(9)
.width(Fill)
.align_x(iced::Center)
.wrapping(iced::advanced::text::Wrapping::Word)
.style(muted_text_style),
keytips::label_anchor(
|| keytips::label_id(&keytips::collapsed_anchor(title)),
text(localized_title.clone())
.size(9)
.width(Fill)
.align_x(iced::Center)
.wrapping(iced::advanced::text::Wrapping::Word)
.style(muted_text_style),
),
crate::ui::icons::themed_secondary_arrow_down(8.0),
]
.spacing(3)