pub struct DesignTokens {Show 110 fields
pub theme: Theme,
pub large_button_size: Vec2,
pub large_button_icon_size: Vec2,
pub large_button_corner_radius: f32,
pub small_icon_size: Vec2,
pub modal_button_width: f32,
pub default_modal_width: f32,
pub top_bar_color: Color32,
pub bottom_bar_color: Color32,
pub bottom_bar_stroke: Stroke,
pub shadow_gradient_dark_start: Color32,
pub tab_bar_color: Color32,
pub native_frame_stroke: Stroke,
pub strong_fg_color: Color32,
pub info_log_text_color: Color32,
pub debug_log_text_color: Color32,
pub trace_log_text_color: Color32,
pub success_text_color: Color32,
pub info_text_color: Color32,
pub viewport_background: Color32,
pub highlight_color: Color32,
pub label_button_icon_color: Color32,
pub section_header_color: Color32,
pub loop_selection_color: Color32,
pub loop_selection_color_inactive: Color32,
pub loop_everything_color: Color32,
pub thumbnail_background_color: Color32,
pub example_card_background_color: Color32,
pub example_tag_bg_fill: Color32,
pub example_tag_stroke: Stroke,
pub surface_on_primary_hovered: Color32,
pub text_color_on_primary: Color32,
pub text_color_on_primary_hovered: Color32,
pub icon_color_on_primary: Color32,
pub icon_color_on_primary_hovered: Color32,
pub selection_stroke_color: Color32,
pub selection_bg_fill: Color32,
pub focus_outline_stroke: Stroke,
pub focus_halo_stroke: Stroke,
pub panel_bg_color: Color32,
pub text_edit_bg_color: Color32,
pub blueprint_time_panel_bg_fill: Color32,
pub notification_panel_background_color: Color32,
pub notification_background_color: Color32,
pub table_header_bg_fill: Color32,
pub table_header_stroke_color: Color32,
pub table_interaction_hovered_bg_stroke: Color32,
pub table_interaction_active_bg_stroke: Color32,
pub table_interaction_noninteractive_bg_stroke: Color32,
pub table_interaction_row_selection_fill: Color32,
pub table_sort_icon_color: Color32,
pub drag_pill_droppable_fill: Color32,
pub drag_pill_droppable_stroke: Color32,
pub drag_pill_nondroppable_fill: Color32,
pub drag_pill_nondroppable_stroke: Color32,
pub drop_target_container_stroke: Stroke,
pub tile_drag_preview_stroke: Stroke,
pub tile_drag_preview_color: Color32,
pub floating_color: Color32,
pub faint_bg_color: Color32,
pub extreme_bg_color: Color32,
pub extreme_fg_color: Color32,
pub widget_inactive_bg_fill: Color32,
pub widget_hovered_color: Color32,
pub widget_hovered_weak_bg_fill: Color32,
pub widget_hovered_bg_fill: Color32,
pub widget_active_weak_bg_fill: Color32,
pub widget_active_bg_fill: Color32,
pub widget_open_weak_bg_fill: Color32,
pub widget_noninteractive_weak_bg_fill: Color32,
pub widget_noninteractive_bg_fill: Color32,
pub widget_noninteractive_bg_stroke: Color32,
pub text_subdued: Color32,
pub text_default: Color32,
pub text_strong: Color32,
pub error_fg_color: Color32,
pub warn_fg_color: Color32,
pub popup_shadow_color: Color32,
pub alert_success: AlertVisuals,
pub alert_info: AlertVisuals,
pub alert_warning: AlertVisuals,
pub alert_error: AlertVisuals,
pub density_graph_selected: Color32,
pub density_graph_unselected: Color32,
pub density_graph_outside_valid_ranges: Color32,
pub axis_color_x: Color32,
pub axis_color_y: Color32,
pub axis_color_z: Color32,
pub frustum_color: Color32,
pub list_item_active_text: Color32,
pub list_item_noninteractive_text: Color32,
pub list_item_hovered_text: Color32,
pub list_item_default_text: Color32,
pub list_item_strong_text: Color32,
pub list_item_active_icon: Color32,
pub list_item_hovered_icon: Color32,
pub list_item_default_icon: Color32,
pub list_item_hovered_bg: Color32,
pub list_item_active_bg: Color32,
pub list_item_collapse_default: Color32,
pub code_index_color: Color32,
pub code_string_color: Color32,
pub code_null_color: Color32,
pub code_primitive_color: Color32,
pub code_keyword_color: Color32,
pub table_filter_frame_stroke: Stroke,
pub bg_fill_inverse: Color32,
pub bg_fill_inverse_hover: Color32,
pub text_inverse: Color32,
pub icon_inverse: Color32,
/* private fields */
}Expand description
The look and feel of the UI.
Not everything is covered by this.
A lot of other design tokens are put straight into the egui::Style
Fields§
§theme: Theme§small_icon_size: Vec2§default_modal_width: f32§top_bar_color: Color32§bottom_bar_color: Color32§bottom_bar_stroke: Stroke§shadow_gradient_dark_start: Color32§tab_bar_color: Color32§native_frame_stroke: Stroke§strong_fg_color: Color32Usually black or white
info_log_text_color: Color32§debug_log_text_color: Color32§trace_log_text_color: Color32§success_text_color: Color32§info_text_color: Color32§viewport_background: Color32Background color for viewport views.
highlight_color: Color32Background color for widgets that should catch the user’s attention.
Color of an icon next to a label
section_header_color: Color32The color for the background of crate::SectionCollapsingHeader.
loop_selection_color: Color32The color we use to mean “loop this selection”
loop_selection_color_inactive: Color32Like Self::loop_selection_color, but inactive.
loop_everything_color: Color32The color we use to mean “loop all the data”
thumbnail_background_color: Color32Color for thumbnail backgrounds
example_card_background_color: Color32Color for example card backgrounds
example_tag_bg_fill: Color32§example_tag_stroke: Stroke§surface_on_primary_hovered: Color32§text_color_on_primary: Color32§text_color_on_primary_hovered: Color32§icon_color_on_primary: Color32§icon_color_on_primary_hovered: Color32§selection_stroke_color: Color32§selection_bg_fill: Color32§focus_outline_stroke: Stroke§focus_halo_stroke: Stroke§panel_bg_color: Color32§text_edit_bg_color: Color32§blueprint_time_panel_bg_fill: Color32Color for blueprint time panel background
notification_panel_background_color: Color32Color for notification panel background
notification_background_color: Color32Color for notification background
table_header_bg_fill: Color32Color for table header background
table_header_stroke_color: Color32Color for table header stroke
table_interaction_hovered_bg_stroke: Color32Color for table interaction hovered background stroke
table_interaction_active_bg_stroke: Color32Color for table interaction active background stroke
table_interaction_noninteractive_bg_stroke: Color32Color for table interaction noninteractive background stroke
table_interaction_row_selection_fill: Color32§table_sort_icon_color: Color32§drag_pill_droppable_fill: Color32§drag_pill_droppable_stroke: Color32§drag_pill_nondroppable_fill: Color32§drag_pill_nondroppable_stroke: Color32§drop_target_container_stroke: StrokeStroke used to indicate that a UI element is a container that will receive a drag-and-drop payload.
Sometimes this is the UI element that is being dragged over (e.g., a view receiving a new entity). Sometimes this is a UI element not under the pointer, but whose content is being hovered (e.g., a container in the blueprint tree)
tile_drag_preview_stroke: StrokeWhen drag-and-dropping a tile, the candidate area is drawn with this stroke.
tile_drag_preview_color: Color32When drag-and-dropping a tile, the candidate area is drawn with this background color.
floating_color: Color32§faint_bg_color: Color32§extreme_bg_color: Color32§extreme_fg_color: Color32§widget_inactive_bg_fill: Color32§widget_hovered_color: Color32§widget_hovered_weak_bg_fill: Color32§widget_hovered_bg_fill: Color32§widget_active_weak_bg_fill: Color32§widget_active_bg_fill: Color32§widget_open_weak_bg_fill: Color32§widget_noninteractive_weak_bg_fill: Color32§widget_noninteractive_bg_fill: Color32§widget_noninteractive_bg_stroke: Color32§text_subdued: Color32§text_default: Color32§text_strong: Color32§error_fg_color: Color32§warn_fg_color: Color32§popup_shadow_color: Color32§alert_success: AlertVisuals§alert_info: AlertVisuals§alert_warning: AlertVisuals§alert_error: AlertVisuals§density_graph_selected: Color32§density_graph_unselected: Color32§density_graph_outside_valid_ranges: Color32This is the color of time ranges that has only been partially loaded.
axis_color_x: Color32§axis_color_y: Color32§axis_color_z: Color32§frustum_color: Color32§list_item_active_text: Color32§list_item_noninteractive_text: Color32§list_item_hovered_text: Color32§list_item_default_text: Color32§list_item_strong_text: Color32§list_item_active_icon: Color32§list_item_hovered_icon: Color32§list_item_default_icon: Color32§list_item_hovered_bg: Color32§list_item_active_bg: Color32§list_item_collapse_default: Color32§code_index_color: Color32§code_string_color: Color32§code_null_color: Color32§code_primitive_color: Color32§code_keyword_color: Color32§table_filter_frame_stroke: Stroke§bg_fill_inverse: Color32§bg_fill_inverse_hover: Color32§text_inverse: Color32§icon_inverse: Color32Implementations§
Source§impl DesignTokens
impl DesignTokens
Sourcepub fn load(theme: Theme, tokens_ron: &str) -> Result<Self>
pub fn load(theme: Theme, tokens_ron: &str) -> Result<Self>
Load design tokens from data/design_tokens_*.ron.
pub fn welcome_screen_h1() -> TextStyle
pub fn welcome_screen_h2() -> TextStyle
pub fn welcome_screen_example_title() -> TextStyle
pub fn welcome_screen_body() -> TextStyle
pub fn welcome_screen_tag() -> TextStyle
Sourcepub fn view_padding(&self) -> i8
pub fn view_padding(&self) -> i8
Margin on all sides of views.
pub fn panel_margin(&self) -> Margin
pub fn window_corner_radius(&self) -> u8
pub fn normal_corner_radius(&self) -> u8
pub fn small_corner_radius(&self) -> u8
pub fn table_cell_margin(&self, table_style: TableStyle) -> Margin
Sourcepub fn table_row_height(&self, table_style: TableStyle) -> f32
pub fn table_row_height(&self, table_style: TableStyle) -> f32
The total row height, including margin/spacing.
Sourcepub fn table_content_height(&self, table_style: TableStyle) -> f32
pub fn table_content_height(&self, table_style: TableStyle) -> f32
The max height of the content.
pub fn header_cell_margin(&self, _table_style: TableStyle) -> Margin
pub fn table_header_height(&self) -> f32
pub fn deprecated_table_header_height(&self) -> f32
pub fn top_bar_margin(&self) -> Margin
pub fn text_to_icon_padding(&self) -> f32
Sourcepub fn top_bar_height(&self) -> f32
pub fn top_bar_height(&self) -> f32
Height of the top-most bar.
Sourcepub fn title_bar_height(&self) -> f32
pub fn title_bar_height(&self) -> f32
Height of the title row in the blueprint view and selection view, as well as the tab bar height in the viewport view.
pub fn list_item_height() -> f32
pub fn list_header_vertical_offset() -> f32
pub fn list_header_font_size() -> f32
pub fn native_window_corner_radius(&self) -> u8
pub fn top_panel_frame(&self) -> Frame
Sourcepub fn popup_frame(&self, style: &Style) -> Frame
pub fn popup_frame(&self, style: &Style) -> Frame
Something that provides contrast vs the background
pub fn bottom_panel_margin(&self) -> Margin
Sourcepub fn bottom_panel_frame(&self) -> Frame
pub fn bottom_panel_frame(&self) -> Frame
For the streams view (time panel)
pub fn setup_table_header(_header: &mut TableRow<'_, '_>)
pub fn setup_table_body( &self, body: &mut TableBody<'_>, table_style: TableStyle, )
Sourcepub fn collapsing_triangle_size(&self) -> Vec2
pub fn collapsing_triangle_size(&self) -> Vec2
Layout area to allocate for the collapsing triangle.
Note that this is not the size of the collapsing triangle (which is defined by
crate::UiExt::paint_collapsing_triangle), but how much screen real-estate should be
allocated for it. It’s set to the same size as the small icon size so that everything is
properly aligned in crate::list_item::ListItem.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DesignTokens
impl RefUnwindSafe for DesignTokens
impl Send for DesignTokens
impl Sync for DesignTokens
impl Unpin for DesignTokens
impl UnwindSafe for DesignTokens
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.