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§
Provided Methods§
Sourcefn text_format_body(&self) -> TextFormat
fn text_format_body(&self) -> TextFormat
Text format used for regular body.
Sourcefn text_format_key(&self) -> TextFormat
fn text_format_key(&self) -> TextFormat
Text format used for labels referring to keys and buttons.
fn rerun_logo_uri(&self) -> &'static str
Sourcefn hover_stroke(&self) -> Stroke
fn hover_stroke(&self) -> Stroke
Hovered UI and spatial primitives should have this outline.
Sourcefn selection_stroke(&self) -> Stroke
fn selection_stroke(&self) -> Stroke
Selected UI and spatial primitives should have this outline.
Sourcefn success_text(&self, text: impl Into<String>) -> RichText
fn success_text(&self, text: impl Into<String>) -> RichText
Text colored to indicate success.
Sourcefn warning_text(&self, text: impl Into<String>) -> RichText
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.
Sourcefn error_text(&self, text: impl Into<String>) -> RichText
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.
fn top_bar_style(&self, style_like_web: bool) -> TopBarStyle
Sourcefn paint_watermark(&self)
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.