(ui: &mut Ui, items: Vec<HoverItem>, appearance: &Appearance)
| 919 | } |
| 920 | |
| 921 | pub 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 | |
| 954 | pub fn context_menu_items_ui( |
| 955 | ui: &mut Ui, |
no test coverage detected