Struct hypex_ui::HypexUi

source ·
pub struct HypexUi {
    pub egui_ctx: Context,
    pub design_tokens: DesignTokens,
    pub static_image_cache: Arc<Mutex<StaticImageCache>>,
}

Fields§

§egui_ctx: Context§design_tokens: DesignTokens

Colors, styles etc loaded from a design_tokens.json

§static_image_cache: Arc<Mutex<StaticImageCache>>

Implementations§

source§

impl HypexUi

source

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

Create HypexUi and apply style to the given egui context.

source

pub fn view_padding() -> f32

Margin on all sides of views.

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 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 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 icon_image(&self, icon: &Icon) -> Arc<RetainedImage>

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 large_collapsing_header<R>( &self, ui: &mut Ui, label: &str, default_open: bool, add_body: impl FnOnce(&mut Ui) -> R )

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.

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 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: RangeInclusive<f32>, stroke: Stroke )

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

Trait Implementations§

source§

impl Clone for HypexUi

source§

fn clone(&self) -> HypexUi

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§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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 Twhere 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 Twhere T: 'static + Any + Clone + Send + Sync,