re_component_ui 0.37.0

Provides ui editors for Rerun component data for registration with the Rerun Viewer component ui registry.
Documentation
use re_data_ui::item_ui;
use re_sdk_types::encodings::Uuid;
use re_viewer_context::{MaybeMutRef, StoreViewContext, ViewId};

pub fn view_view_id(
    ctx: &re_viewer_context::AppContext<'_>,
    ui: &mut egui::Ui,
    value: &mut MaybeMutRef<'_, impl std::ops::DerefMut<Target = Uuid>>,
) -> egui::Response {
    // An edit ui could be a drop down with all known views! But that's for another day.
    view_view_id_impl(ctx, ui, value.as_ref())
}

fn view_view_id_impl(
    ctx: &re_viewer_context::AppContext<'_>,
    ui: &mut egui::Ui,
    value: &Uuid,
) -> egui::Response {
    let view = ViewId::from(*value);
    if let Some(store_view_ctx) = StoreViewContext::for_active_recording(ctx) {
        item_ui::entity_path_button_to(
            &store_view_ctx,
            ui,
            None,
            &view.as_entity_path(),
            view.to_string(),
        )
    } else {
        ui.label(view.to_string())
    }
}