mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 14:50:03 -04:00
@@ -13,11 +13,11 @@ pub(crate) struct TooltipState {
|
||||
|
||||
impl TooltipState {
|
||||
pub fn load(ctx: &Context) -> Option<Self> {
|
||||
ctx.data_mut(|d| d.get_temp(Id::null()))
|
||||
ctx.data_mut(|d| d.get_temp(Id::NULL))
|
||||
}
|
||||
|
||||
fn store(self, ctx: &Context) {
|
||||
ctx.data_mut(|d| d.insert_temp(Id::null(), self));
|
||||
ctx.data_mut(|d| d.insert_temp(Id::NULL, self));
|
||||
}
|
||||
|
||||
fn individual_tooltip_size(&self, common_id: Id, index: usize) -> Option<Vec2> {
|
||||
|
||||
@@ -35,6 +35,9 @@ impl Id {
|
||||
///
|
||||
/// The null [`Id`] is still a valid id to use in all circumstances,
|
||||
/// though obviously it will lead to a lot of collisions if you do use it!
|
||||
pub const NULL: Self = Self(0);
|
||||
|
||||
#[deprecated = "Use Id::NULL"]
|
||||
pub fn null() -> Self {
|
||||
Self(0)
|
||||
}
|
||||
|
||||
@@ -442,5 +442,5 @@ fn color_cache_set(ctx: &Context, rgba: impl Into<Rgba>, hsva: Hsva) {
|
||||
|
||||
// To ensure we keep hue slider when `srgba` is gray we store the full [`Hsva`] in a cache:
|
||||
fn use_color_cache<R>(ctx: &Context, f: impl FnOnce(&mut FixedCache<Rgba, Hsva>) -> R) -> R {
|
||||
ctx.data_mut(|d| f(d.get_temp_mut_or_default(Id::null())))
|
||||
ctx.data_mut(|d| f(d.get_temp_mut_or_default(Id::NULL)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user