Create mod util

This commit is contained in:
Emil Ernerfeldt 2020-11-15 16:20:51 +01:00
parent fe0d159324
commit 83444af862
8 changed files with 14 additions and 9 deletions

View file

@ -1,4 +1,4 @@
use crate::{app, demos, Context, History, Ui}; use crate::{app, demos, util::History, Context, Ui};
use std::sync::Arc; use std::sync::Arc;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View file

@ -1,6 +1,6 @@
//! The input needed by Egui. //! The input needed by Egui.
use crate::{math::*, History}; use crate::{math::*, util::History};
/// If mouse moves more than this, it is no longer a click (but maybe a drag) /// If mouse moves more than this, it is no longer a click (but maybe a drag)
const MAX_CLICK_DIST: f32 = 6.0; const MAX_CLICK_DIST: f32 = 6.0;

View file

@ -60,11 +60,9 @@
pub mod align; pub mod align;
mod animation_manager; mod animation_manager;
pub mod app; pub mod app;
pub(crate) mod cache;
pub mod containers; pub mod containers;
mod context; mod context;
pub mod demos; pub mod demos;
mod history;
mod id; mod id;
mod input; mod input;
mod introspection; mod introspection;
@ -73,12 +71,12 @@ mod layout;
pub mod math; pub mod math;
mod memory; mod memory;
pub mod menu; pub mod menu;
pub mod mutex;
pub mod paint; pub mod paint;
mod painter; mod painter;
mod style; mod style;
mod types; mod types;
mod ui; mod ui;
pub mod util;
pub mod widgets; pub mod widgets;
pub use { pub use {
@ -86,7 +84,6 @@ pub use {
containers::*, containers::*,
context::Context, context::Context,
demos::DemoApp, demos::DemoApp,
history::History,
id::Id, id::Id,
input::*, input::*,
layers::*, layers::*,
@ -101,6 +98,7 @@ pub use {
style::Style, style::Style,
types::*, types::*,
ui::Ui, ui::Ui,
util::mutex,
widgets::*, widgets::*,
}; };

View file

@ -1,11 +1,10 @@
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet};
use crate::{ use crate::{
area, area, collapsing_header, menu,
cache::Cache,
collapsing_header, menu,
paint::color::{Hsva, Srgba}, paint::color::{Hsva, Srgba},
resize, scroll_area, resize, scroll_area,
util::Cache,
widgets::text_edit, widgets::text_edit,
window, Id, LayerId, Pos2, Rect, window, Id, LayerId, Pos2, Rect,
}; };

8
egui/src/util/mod.rs Normal file
View file

@ -0,0 +1,8 @@
//! Tools used by Egui, but that doesn't depend on anything in Egui.
pub(crate) mod cache;
mod history;
pub mod mutex;
pub(crate) use cache::Cache;
pub use history::History;