Compare commits
3 Commits
master
...
better-aut
Author | SHA1 | Date |
---|---|---|
Emil Ernerfeldt | 038350e3bd | |
Emil Ernerfeldt | 1e2df868ca | |
Emil Ernerfeldt | 23a74900ae |
|
@ -60,8 +60,9 @@ impl Id {
|
|||
format!("{:04X}", self.0 as u16)
|
||||
}
|
||||
|
||||
/// The contained value.
|
||||
#[inline(always)]
|
||||
pub(crate) fn value(&self) -> u64 {
|
||||
pub fn value(&self) -> u64 {
|
||||
self.0
|
||||
}
|
||||
|
||||
|
|
|
@ -97,17 +97,19 @@ impl Ui {
|
|||
id_source: impl Hash,
|
||||
) -> Self {
|
||||
crate::egui_assert!(!max_rect.any_nan());
|
||||
let next_auto_id_source = Id::new(self.next_auto_id_source).with("child").value();
|
||||
let child_id = self.id.with(id_source);
|
||||
let child_next_auto_id_source = child_id.with(self.next_auto_id_source).value();
|
||||
|
||||
self.next_auto_id_source = self.next_auto_id_source.wrapping_add(1);
|
||||
let menu_state = self.menu_state();
|
||||
|
||||
Ui {
|
||||
id: self.id.with(id_source),
|
||||
next_auto_id_source,
|
||||
id: child_id,
|
||||
next_auto_id_source: child_next_auto_id_source,
|
||||
painter: self.painter.clone(),
|
||||
style: self.style.clone(),
|
||||
placer: Placer::new(max_rect, layout),
|
||||
enabled: self.enabled,
|
||||
menu_state,
|
||||
menu_state: self.menu_state.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2232,10 +2234,6 @@ impl Ui {
|
|||
self.menu_state = None;
|
||||
}
|
||||
|
||||
pub(crate) fn menu_state(&self) -> Option<Arc<RwLock<MenuState>>> {
|
||||
self.menu_state.clone()
|
||||
}
|
||||
|
||||
pub(crate) fn set_menu_state(&mut self, menu_state: Option<Arc<RwLock<MenuState>>>) {
|
||||
self.menu_state = menu_state;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue