[go: up one dir, main page]

Struct re_ui::ReUi

source ·
pub struct ReUi {
    pub egui_ctx: Context,
    pub design_tokens: DesignTokens,
}

Fields§

§egui_ctx: Context§design_tokens: DesignTokens

Colors, styles etc loaded from a design_tokens.json

Implementations§

source§

impl ReUi

source

pub fn load_and_apply(egui_ctx: &Context) -> Self

Create ReUi and apply style to the given egui context.

source

pub fn welcome_screen_h1() -> TextStyle

Welcome screen big title

source

pub fn welcome_screen_h2() -> TextStyle

source

pub fn welcome_screen_h3() -> TextStyle

source

pub fn welcome_screen_body() -> TextStyle

source

pub fn welcome_screen_tab_bar_style(ui: &mut Ui)

source

pub fn view_padding() -> f32

Margin on all sides of views.

source

pub fn panel_margin() -> Margin

source

pub fn window_rounding() -> f32

source

pub fn normal_rounding() -> f32

source

pub fn small_rounding() -> f32

source

pub fn table_line_height() -> f32

source

pub fn table_header_height() -> f32

source

pub fn top_bar_margin() -> Margin

source

pub fn text_to_icon_padding() -> f32

source

pub fn top_bar_height() -> f32

Height of the top-most bar.

source

pub fn title_bar_height() -> f32

Height of the title row in the blueprint view and selection view, as well as the tab bar height in the viewport view.

source

pub fn list_item_height() -> f32

source

pub fn native_window_rounding() -> f32

source

pub fn top_panel_frame(&self) -> Frame

source

pub fn bottom_panel_margin(&self) -> Vec2

source

pub fn bottom_panel_frame(&self) -> Frame

For the streams view (time panel)

source

pub fn small_icon_size() -> Vec2

source

pub fn setup_table_header(_header: &mut TableRow<'_, '_>)

source

pub fn setup_table_body(body: &mut TableBody<'_>)

source

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

source

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

source

pub fn loop_selection_color() -> Color32

The color we use to mean “loop this selection”

source

pub fn loop_everything_color() -> Color32

The color we use to mean “loop all the data”

source

pub fn paint_watermark(&self)

Paint a watermark

source

pub fn top_bar_style( &self, native_pixels_per_point: Option<f32>, fullscreen: bool, style_like_web: bool ) -> TopBarStyle

source

pub fn small_icon_button(&self, ui: &mut Ui, icon: &Icon) -> Response

source

pub fn medium_icon_toggle_button( &self, ui: &mut Ui, icon: &Icon, selected: &mut bool ) -> Response

source

pub fn checkbox( &self, ui: &mut Ui, selected: &mut bool, text: impl Into<WidgetText> ) -> Response

source

pub fn radio_value<Value: PartialEq>( &self, ui: &mut Ui, current_value: &mut Value, alternative: Value, text: impl Into<WidgetText> ) -> Response

source

pub fn large_button(&self, ui: &mut Ui, icon: &Icon) -> Response

source

pub fn large_button_selected( &self, ui: &mut Ui, icon: &Icon, selected: bool ) -> Response

source

pub fn visibility_toggle_button( &self, ui: &mut Ui, visible: &mut bool ) -> Response

source

pub fn panel_content<R>( &self, ui: &mut Ui, add_contents: impl FnOnce(&ReUi, &mut Ui) -> R ) -> R

source

pub fn panel_title_bar( &self, ui: &mut Ui, label: &str, hover_text: Option<&str> )

Static title bar used to separate panels into section.

This title bar is meant to be used in a panel with proper inner margin and clip rectangle set.

Use ReUi::panel_title_bar_with_buttons to display buttons in the title bar.

source

pub fn panel_title_bar_with_buttons<R>( &self, ui: &mut Ui, label: &str, hover_text: Option<&str>, add_right_buttons: impl FnOnce(&mut Ui) -> R ) -> R

Static title bar used to separate panels into section with custom buttons when hovered.

This title bar is meant to be used in a panel with proper inner margin and clip rectangle set.

source

pub fn large_collapsing_header<R>( &self, ui: &mut Ui, label: &str, default_open: bool, add_body: impl FnOnce(&mut Ui) -> R )

Show a prominent collapsing header to be used as section delimitation in side panels.

Note that a clip rect must be set (typically by the panel) to avoid any overdraw.

source

pub fn collapsing_triangle_size() -> Vec2

Size for the collapsing triangle icon.

See ReUi::paint_collapsing_triangle for actually drawing the triangle.

source

pub fn paint_collapsing_triangle( ui: &mut Ui, openness: f32, rect: Rect, response: &Response )

Paint a collapsing triangle with rounded corners.

Alternative to egui::collapsing_header::paint_default_icon.

source

pub fn grid_left_hand_label(&self, ui: &mut Ui, label: &str) -> Response

Workaround for putting a label into a grid at the top left of its row.

source

pub fn selection_grid(&self, _ui: &mut Ui, id: &str) -> Grid

Two-column grid to be used in selection view.

Use this when you expect the right column to have multi-line entries.

source

pub fn draw_shadow_line(&self, ui: &mut Ui, rect: Rect, direction: Direction)

Draws a shadow into the given rect with the shadow direction given from dark to light

source

pub fn list_item(&self, text: impl Into<WidgetText>) -> ListItem<'_>

Convenience function to create a ListItem with the given text.

source

pub fn selectable_label_with_icon( &self, ui: &mut Ui, icon: &Icon, text: impl Into<WidgetText>, selected: bool ) -> Response

source

pub fn text_format_body(&self) -> TextFormat

Text format used for regular body.

source

pub fn text_format_key(&self) -> TextFormat

Text format used for labels referring to keys and buttons.

source

pub fn paint_time_cursor( &self, painter: &Painter, x: f32, y: Rangef, stroke: Stroke )

Paints a time cursor for indicating the time on a time axis along x.

Trait Implementations§

source§

impl Clone for ReUi

source§

fn clone(&self) -> ReUi

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for ReUi

§

impl Send for ReUi

§

impl Sync for ReUi

§

impl Unpin for ReUi

§

impl !UnwindSafe for ReUi

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,