S or /

SourceClass Style

from egui import Style
class Style:

Specifies the look and feel of egui.

You can change the visuals of a Ui with Ui.style_mut and of everything with egui.Context.set_style_of. To choose between dark and light style, use egui.Context.set_theme.

If you want to change fonts, use egui.Context.set_fonts instead.

Properties§

@property def always_scroll_the_only_direction(self, /) -> bool§
@always_scroll_the_only_direction.setter def always_scroll_the_only_direction(self, /, always_scroll_the_only_direction: bool) -> None§
@property def animation_time(self, /) -> float§
@animation_time.setter def animation_time(self, /, animation_time: float) -> None§
@property def compact_menu_style(self, /) -> bool§
@compact_menu_style.setter def compact_menu_style(self, /, compact_menu_style: bool) -> None§
@property def debug(self, /) -> Any§
@debug.setter def debug(self, /, debug: Any) -> None§
@property def drag_value_text_style(self, /) -> TextStyle§
@drag_value_text_style.setter def drag_value_text_style(self, /, drag_value_text_style: TextStyle) -> None§
@property def explanation_tooltips(self, /) -> bool§
@explanation_tooltips.setter def explanation_tooltips(self, /, explanation_tooltips: bool) -> None§
@property def interaction(self, /) -> Interaction§
@interaction.setter def interaction(self, /, interaction: Interaction) -> None§
@property def number_formatter(self, /) -> NumberFormatter§
@number_formatter.setter def number_formatter(self, /, number_formatter: NumberFormatter) -> None§
@property def override_font_id(self, /) -> FontId |None§
@override_font_id.setter def override_font_id(self, /, override_font_id: FontId |None) -> None§
@property def override_text_style(self, /) -> TextStyle |None§
@override_text_style.setter def override_text_style(self, /, override_text_style: TextStyle |None) -> None§
@property def override_text_valign(self, /) -> Align |None§
@override_text_valign.setter def override_text_valign(self, /, override_text_valign: Align |None) -> None§
@property def scroll_animation(self, /) -> ScrollAnimation§
@scroll_animation.setter def scroll_animation(self, /, scroll_animation: ScrollAnimation) -> None§
@property def spacing(self, /) -> Spacing§
@spacing.setter def spacing(self, /, spacing: Spacing) -> None§
Source@property def text_styles(self, /) -> TextStyles§

All known text styles.

@text_styles.setter def text_styles(self, /, text_styles: TextStyles) -> None§
@property def url_in_tooltip(self, /) -> bool§
@url_in_tooltip.setter def url_in_tooltip(self, /, url_in_tooltip: bool) -> None§
@property def wrap(self, /) -> bool |None§
@wrap.setter def wrap(self, /, wrap: bool |None) -> None§
@property def wrap_mode_value(self, /) -> TextWrapMode |None§
@wrap_mode_value.setter def wrap_mode_value(self, /, wrap_mode: TextWrapMode |None) -> None§

Methods§

def button_style(self, /, state: WidgetState, selected: bool) -> ButtonStyle§
def checkbox_style(self, /, state: WidgetState) -> CheckboxStyle§
def debug_mut(self, /) -> Any: """ Edit a copy and write it back when the async context exits. """§

Edit a copy and write it back when the async context exits.

@staticmethod def default() -> Style§
Sourcedef interact(self, /, response: Response) -> WidgetVisuals§

Use this style for interactive things. Note that you must already have a response, i.e. you must allocate space and interact BEFORE painting the widget!

Sourcedef interact_selectable(self, /, response: Response, selected: bool) -> WidgetVisuals§
def interaction_mut(self, /) -> Any: """ Edit a copy and write it back when the async context exits. """§

Edit a copy and write it back when the async context exits.

def label_style(self, /, state: WidgetState) -> LabelStyle§
Sourcedef noninteractive(self, /) -> WidgetVisuals§

Style to use for non-interactive widgets.

def remove_text_style(self, /, text_style: TextStyle) -> FontId |None§
def scroll_animation_mut(self, /) -> Any: """ Edit a copy and write it back when the async context exits. """§

Edit a copy and write it back when the async context exits.

def separator_style(self, /, state: WidgetState) -> SeparatorStyle§
def set_text_style(self, /, text_style: TextStyle, font_id: FontId) -> None§
def set_visuals(self, /, visuals: Visuals) -> None§
def spacing_mut(self, /) -> Any: """ Edit a copy and write it back when the async context exits. """§

Edit a copy and write it back when the async context exits.

def text_style(self, /, text_style: TextStyle) -> FontId |None§
Sourcedef ui(self, /, ui: Ui) -> None§
def visuals(self, /) -> Visuals§
def visuals_mut(self, /) -> Any: """ Edit a copy and write it back when the async context exits. """§

Edit a copy and write it back when the async context exits.

def widget_style(self, /, state: WidgetState) -> WidgetStyle§