re_component_ui 0.37.0

Provides ui editors for Rerun component data for registration with the Rerun Viewer component ui registry.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use re_sdk_types::encodings::Uuid;
use re_ui::syntax_highlighting::SyntaxHighlightedBuilder;
use re_viewer_context::{MaybeMutRef, UiLayout};

pub fn view_uuid(
    _ctx: &re_viewer_context::AppContext<'_>,
    ui: &mut egui::Ui,
    value: &mut MaybeMutRef<'_, impl std::ops::DerefMut<Target = Uuid>>,
) -> egui::Response {
    UiLayout::List.data_label(
        ui,
        SyntaxHighlightedBuilder::new().with_primitive(&value.as_ref().to_string()),
    )
}