mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-11 05:28:35 +00:00
slightly borked the rebase
This commit is contained in:
parent
f743fefe79
commit
83b6dc8d5f
@ -5,6 +5,7 @@ use crate::input::mouse::MouseButton;
|
||||
use crate::math::MintVec2;
|
||||
use crate::style::StyleColor;
|
||||
use crate::sys;
|
||||
use crate::Style;
|
||||
use crate::Ui;
|
||||
|
||||
bitflags! {
|
||||
@ -178,20 +179,20 @@ impl<'ui> Ui<'ui> {
|
||||
pub fn style_color(&self, style_color: StyleColor) -> [f32; 4] {
|
||||
self.ctx.style()[style_color]
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns a shared reference to the current [`Style`].
|
||||
///
|
||||
/// ## Safety
|
||||
///
|
||||
/// This function is tagged as `unsafe` because pushing via
|
||||
/// [`push_style_color`](crate::Ui::push_style_color) or
|
||||
/// [`push_style_var`](crate::Ui::push_style_var) or popping via
|
||||
/// [`ColorStackToken::pop`](crate::ColorStackToken::pop) or
|
||||
/// [`StyleStackToken::pop`](crate::StyleStackToken::pop) will modify the values in the returned
|
||||
/// shared reference. Therefore, you should not retain this reference across calls to push and
|
||||
/// pop. The [`clone_style`](Ui::clone_style) version may instead be used to avoid `unsafe`.
|
||||
#[doc(alias = "GetStyle")]
|
||||
pub unsafe fn style(&self) -> &Style {
|
||||
self.ctx.style()
|
||||
/// Returns a shared reference to the current [`Style`].
|
||||
///
|
||||
/// ## Safety
|
||||
///
|
||||
/// This function is tagged as `unsafe` because pushing via
|
||||
/// [`push_style_color`](crate::Ui::push_style_color) or
|
||||
/// [`push_style_var`](crate::Ui::push_style_var) or popping via
|
||||
/// [`ColorStackToken::pop`](crate::ColorStackToken::pop) or
|
||||
/// [`StyleStackToken::pop`](crate::StyleStackToken::pop) will modify the values in the returned
|
||||
/// shared reference. Therefore, you should not retain this reference across calls to push and
|
||||
/// pop. The [`clone_style`](Ui::clone_style) version may instead be used to avoid `unsafe`.
|
||||
#[doc(alias = "GetStyle")]
|
||||
pub unsafe fn style(&self) -> &Style {
|
||||
self.ctx.style()
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user