Style

Struct Style 

Source
pub struct Style(/* private fields */);
Expand description

User interface style/colors

Note: This is a transparent wrapper over sys::ImGuiStyle (v1.92+ layout). Do not assume field layout here; use accessors or raw()/raw_mut() if needed.

Implementations§

Source§

impl Style

Source

pub fn color(&self, color: StyleColor) -> [f32; 4]

Get a color by style color identifier

Source

pub fn set_color(&mut self, color: StyleColor, value: [f32; 4])

Set a color by style color identifier

Source

pub fn font_scale_main(&self) -> f32

Get main font scale (formerly io.FontGlobalScale)

Source

pub fn set_font_scale_main(&mut self, scale: f32)

Set main font scale (formerly io.FontGlobalScale)

Source

pub fn font_scale_dpi(&self) -> f32

Get DPI font scale (auto-overwritten if ConfigDpiScaleFonts=true)

Source

pub fn set_font_scale_dpi(&mut self, scale: f32)

Set DPI font scale

Source

pub fn font_size_base(&self) -> f32

Base size used by style for font sizing

Source

pub fn set_font_size_base(&mut self, sz: f32)

Source

pub fn alpha(&self) -> f32

Source

pub fn set_alpha(&mut self, v: f32)

Source

pub fn disabled_alpha(&self) -> f32

Source

pub fn set_disabled_alpha(&mut self, v: f32)

Source

pub fn window_padding(&self) -> [f32; 2]

Source

pub fn set_window_padding(&mut self, v: [f32; 2])

Source

pub fn window_rounding(&self) -> f32

Source

pub fn set_window_rounding(&mut self, v: f32)

Source

pub fn window_border_size(&self) -> f32

Source

pub fn set_window_border_size(&mut self, v: f32)

Source

pub fn window_min_size(&self) -> [f32; 2]

Source

pub fn set_window_min_size(&mut self, v: [f32; 2])

Source

pub fn window_title_align(&self) -> [f32; 2]

Source

pub fn set_window_title_align(&mut self, v: [f32; 2])

Source

pub fn window_menu_button_position(&self) -> Direction

Source

pub fn set_window_menu_button_position(&mut self, d: Direction)

Source

pub fn child_rounding(&self) -> f32

Source

pub fn set_child_rounding(&mut self, v: f32)

Source

pub fn child_border_size(&self) -> f32

Source

pub fn set_child_border_size(&mut self, v: f32)

Source

pub fn popup_rounding(&self) -> f32

Source

pub fn set_popup_rounding(&mut self, v: f32)

Source

pub fn popup_border_size(&self) -> f32

Source

pub fn set_popup_border_size(&mut self, v: f32)

Source

pub fn frame_padding(&self) -> [f32; 2]

Source

pub fn set_frame_padding(&mut self, v: [f32; 2])

Source

pub fn frame_rounding(&self) -> f32

Source

pub fn set_frame_rounding(&mut self, v: f32)

Source

pub fn frame_border_size(&self) -> f32

Source

pub fn set_frame_border_size(&mut self, v: f32)

Source

pub fn item_spacing(&self) -> [f32; 2]

Source

pub fn set_item_spacing(&mut self, v: [f32; 2])

Source

pub fn item_inner_spacing(&self) -> [f32; 2]

Source

pub fn set_item_inner_spacing(&mut self, v: [f32; 2])

Source

pub fn cell_padding(&self) -> [f32; 2]

Source

pub fn set_cell_padding(&mut self, v: [f32; 2])

Source

pub fn touch_extra_padding(&self) -> [f32; 2]

Source

pub fn set_touch_extra_padding(&mut self, v: [f32; 2])

Source

pub fn indent_spacing(&self) -> f32

Source

pub fn set_indent_spacing(&mut self, v: f32)

Source

pub fn columns_min_spacing(&self) -> f32

Source

pub fn set_columns_min_spacing(&mut self, v: f32)

Source

pub fn scrollbar_size(&self) -> f32

Source

pub fn set_scrollbar_size(&mut self, v: f32)

Source

pub fn scrollbar_rounding(&self) -> f32

Source

pub fn set_scrollbar_rounding(&mut self, v: f32)

Source

pub fn grab_min_size(&self) -> f32

Source

pub fn set_grab_min_size(&mut self, v: f32)

Source

pub fn grab_rounding(&self) -> f32

Source

pub fn set_grab_rounding(&mut self, v: f32)

Source

pub fn log_slider_deadzone(&self) -> f32

Source

pub fn set_log_slider_deadzone(&mut self, v: f32)

Source

pub fn tab_rounding(&self) -> f32

Source

pub fn set_tab_rounding(&mut self, v: f32)

Source

pub fn tab_border_size(&self) -> f32

Source

pub fn set_tab_border_size(&mut self, v: f32)

Source

pub fn color_button_position(&self) -> Direction

Source

pub fn set_color_button_position(&mut self, d: Direction)

Source

pub fn button_text_align(&self) -> [f32; 2]

Source

pub fn set_button_text_align(&mut self, v: [f32; 2])

Source

pub fn selectable_text_align(&self) -> [f32; 2]

Source

pub fn set_selectable_text_align(&mut self, v: [f32; 2])

Source

pub fn display_window_padding(&self) -> [f32; 2]

Source

pub fn set_display_window_padding(&mut self, v: [f32; 2])

Source

pub fn display_safe_area_padding(&self) -> [f32; 2]

Source

pub fn set_display_safe_area_padding(&mut self, v: [f32; 2])

Source

pub fn mouse_cursor_scale(&self) -> f32

Source

pub fn set_mouse_cursor_scale(&mut self, v: f32)

Source

pub fn anti_aliased_lines(&self) -> bool

Source

pub fn set_anti_aliased_lines(&mut self, v: bool)

Source

pub fn anti_aliased_lines_use_tex(&self) -> bool

Source

pub fn set_anti_aliased_lines_use_tex(&mut self, v: bool)

Source

pub fn anti_aliased_fill(&self) -> bool

Source

pub fn set_anti_aliased_fill(&mut self, v: bool)

Source

pub fn curve_tessellation_tol(&self) -> f32

Source

pub fn set_curve_tessellation_tol(&mut self, v: f32)

Source

pub fn circle_tessellation_max_error(&self) -> f32

Source

pub fn set_circle_tessellation_max_error(&mut self, v: f32)

Source

pub fn window_border_hover_padding(&self) -> f32

Source

pub fn set_window_border_hover_padding(&mut self, v: f32)

Source

pub fn scrollbar_padding(&self) -> f32

Source

pub fn set_scrollbar_padding(&mut self, v: f32)

Source

pub fn image_border_size(&self) -> f32

Source

pub fn set_image_border_size(&mut self, v: f32)

Source

pub fn tab_min_width_base(&self) -> f32

Source

pub fn set_tab_min_width_base(&mut self, v: f32)

Source

pub fn tab_min_width_shrink(&self) -> f32

Source

pub fn set_tab_min_width_shrink(&mut self, v: f32)

Source

pub fn tab_close_button_min_width_selected(&self) -> f32

Source

pub fn set_tab_close_button_min_width_selected(&mut self, v: f32)

Source

pub fn tab_close_button_min_width_unselected(&self) -> f32

Source

pub fn set_tab_close_button_min_width_unselected(&mut self, v: f32)

Source

pub fn tab_bar_border_size(&self) -> f32

Source

pub fn set_tab_bar_border_size(&mut self, v: f32)

Source

pub fn tab_bar_overline_size(&self) -> f32

Source

pub fn set_tab_bar_overline_size(&mut self, v: f32)

Source

pub fn table_angled_headers_angle(&self) -> f32

Source

pub fn set_table_angled_headers_angle(&mut self, v: f32)

Source

pub fn table_angled_headers_text_align(&self) -> [f32; 2]

Source

pub fn set_table_angled_headers_text_align(&mut self, v: [f32; 2])

Source

pub fn tree_lines_flags(&self) -> TreeNodeFlags

Source

pub fn set_tree_lines_flags(&mut self, flags: TreeNodeFlags)

Source

pub fn tree_lines_size(&self) -> f32

Source

pub fn set_tree_lines_size(&mut self, v: f32)

Source

pub fn tree_lines_rounding(&self) -> f32

Source

pub fn set_tree_lines_rounding(&mut self, v: f32)

Source

pub fn separator_text_border_size(&self) -> f32

Source

pub fn set_separator_text_border_size(&mut self, v: f32)

Source

pub fn separator_text_align(&self) -> [f32; 2]

Source

pub fn set_separator_text_align(&mut self, v: [f32; 2])

Source

pub fn separator_text_padding(&self) -> [f32; 2]

Source

pub fn set_separator_text_padding(&mut self, v: [f32; 2])

Source

pub fn docking_node_has_close_button(&self) -> bool

Source

pub fn set_docking_node_has_close_button(&mut self, v: bool)

Source

pub fn docking_separator_size(&self) -> f32

Source

pub fn set_docking_separator_size(&mut self, v: f32)

Source

pub fn hover_stationary_delay(&self) -> f32

Source

pub fn set_hover_stationary_delay(&mut self, v: f32)

Source

pub fn hover_delay_short(&self) -> f32

Source

pub fn set_hover_delay_short(&mut self, v: f32)

Source

pub fn hover_delay_normal(&self) -> f32

Source

pub fn set_hover_delay_normal(&mut self, v: f32)

Source

pub fn hover_flags_for_tooltip_mouse(&self) -> HoveredFlags

Source

pub fn set_hover_flags_for_tooltip_mouse(&mut self, flags: HoveredFlags)

Source

pub fn hover_flags_for_tooltip_nav(&self) -> HoveredFlags

Source

pub fn set_hover_flags_for_tooltip_nav(&mut self, flags: HoveredFlags)

Trait Implementations§

Source§

impl Clone for Style

Source§

fn clone(&self) -> Style

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Style

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Style

Source§

fn eq(&self, other: &Style) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl RawWrapper for Style

Source§

type Raw = ImGuiStyle

Wrapped raw type
Source§

unsafe fn raw(&self) -> &Self::Raw

Returns an immutable reference to the wrapped raw value Read more
Source§

unsafe fn raw_mut(&mut self) -> &mut Self::Raw

Returns a mutable reference to the wrapped raw value Read more
Source§

impl Copy for Style

Source§

impl StructuralPartialEq for Style

Auto Trait Implementations§

§

impl Freeze for Style

§

impl RefUnwindSafe for Style

§

impl Send for Style

§

impl Sync for Style

§

impl Unpin for Style

§

impl UnwindSafe for Style

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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,

Source§

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>,

Source§

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>,

Source§

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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more