1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

Make Id a proper newtype

This commit is contained in:
Emil Ernerfeldt
2020-04-17 23:44:14 +02:00
parent 407df94945
commit 624e709a8f
7 changed files with 46 additions and 38 deletions

View File

@@ -1,10 +1,6 @@
use std::sync::Arc;
use crate::{
layout::{make_id, Direction},
widgets::Label,
*,
};
use crate::{layout::Direction, widgets::Label, *};
#[derive(Clone, Copy, Debug)]
pub struct WindowState {
@@ -28,7 +24,7 @@ impl Window {
where
F: FnOnce(&mut Region),
{
let id = make_id(&self.title);
let id = Id::new(&self.title);
let mut state = ctx.memory.lock().get_or_create_window(
id,
@@ -48,7 +44,7 @@ impl Window {
ctx: ctx.clone(),
layer,
style,
id: Default::default(),
id,
dir: Direction::Vertical,
align: Align::Min,
cursor: state.rect.min() + window_padding,