MCPcopy Index your code
hub / github.com/encounter/objdiff / hover_items_ui

Function hover_items_ui

objdiff-gui/src/views/diff.rs:921–952  ·  view source on GitHub ↗
(ui: &mut Ui, items: Vec<HoverItem>, appearance: &Appearance)

Source from the content-addressed store, hash-verified

919}
920
921pub fn hover_items_ui(ui: &mut Ui, items: Vec<HoverItem>, appearance: &Appearance) {
922 for item in items {
923 match item {
924 HoverItem::Text { label, value, color } => {
925 let mut job = LayoutJob::default();
926 if !label.is_empty() {
927 let label_color = match color {
928 HoverItemColor::Special => appearance.replace_color,
929 HoverItemColor::Delete => appearance.delete_color,
930 HoverItemColor::Insert => appearance.insert_color,
931 _ => appearance.highlight_color,
932 };
933 write_text(&label, label_color, &mut job, appearance.code_font.clone());
934 write_text(": ", label_color, &mut job, appearance.code_font.clone());
935 }
936 write_text(
937 &value,
938 match color {
939 HoverItemColor::Emphasized => appearance.highlight_color,
940 _ => appearance.text_color,
941 },
942 &mut job,
943 appearance.code_font.clone(),
944 );
945 ui.label(job);
946 }
947 HoverItem::Separator => {
948 ui.separator();
949 }
950 }
951 }
952}
953
954pub fn context_menu_items_ui(
955 ui: &mut Ui,

Callers 3

symbol_hover_uiFunction · 0.85
ins_hover_uiFunction · 0.85
data_row_hover_uiFunction · 0.85

Calls 2

write_textFunction · 0.85
separatorMethod · 0.45

Tested by

no test coverage detected