re_viewer::external::re_ui

Trait ContextExt

Source
pub trait ContextExt {
    // Required method
    fn ctx(&self) -> &Context;

    // Provided methods
    fn text_format_body(&self) -> TextFormat { ... }
    fn text_format_key(&self) -> TextFormat { ... }
    fn rerun_logo_uri(&self) -> &'static str { ... }
    fn hover_stroke(&self) -> Stroke { ... }
    fn selection_stroke(&self) -> Stroke { ... }
    fn success_text(&self, text: impl Into<String>) -> RichText { ... }
    fn warning_text(&self, text: impl Into<String>) -> RichText { ... }
    fn error_text(&self, text: impl Into<String>) -> RichText { ... }
    fn top_bar_style(&self, style_like_web: bool) -> TopBarStyle { ... }
    fn paint_watermark(&self) { ... }
}
Expand description

Extension trait for [egui::Context].

This trait provides Rerun-specific helpers and utilities that require access to the egui context.

Required Methods§

Source

fn ctx(&self) -> &Context

Provided Methods§

Source

fn text_format_body(&self) -> TextFormat

Text format used for regular body.

Source

fn text_format_key(&self) -> TextFormat

Text format used for labels referring to keys and buttons.

Source

fn rerun_logo_uri(&self) -> &'static str

Source

fn hover_stroke(&self) -> Stroke

Hovered UI and spatial primitives should have this outline.

Source

fn selection_stroke(&self) -> Stroke

Selected UI and spatial primitives should have this outline.

Source

fn success_text(&self, text: impl Into<String>) -> RichText

Text colored to indicate success.

Source

fn warning_text(&self, text: impl Into<String>) -> RichText

Text colored to indicate a warning.

For most cases, you should use crate::UiExt::warning_label instead, which has a nice fat border around it.

Source

fn error_text(&self, text: impl Into<String>) -> RichText

Text colored to indicate an error.

For most cases, you should use crate::UiExt::error_label instead, which has a nice fat border around it.

Source

fn top_bar_style(&self, style_like_web: bool) -> TopBarStyle

Source

fn paint_watermark(&self)

Paint a watermark

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ContextExt for Context

Source§

fn ctx(&self) -> &Context

Implementors§