move everything out of layout
This commit is contained in:
1 parent
174c447706
commit
a85e129026
48 files changed
+142
-160
No files matched your search
+4
-9
@@ -1,15 +1,10 @@
|
||||
use crate::prelude::*;
|
||||
|
||||
use iris_core::util::{HashMap, Id};
|
||||
use std::{
|
||||
ops::{BitOr, Deref, DerefMut},
|
||||
rc::Rc,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
layout::{UiModule, UiRegion},
|
||||
util::{HashMap, Id, Vec2},
|
||||
};
|
||||
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
pub enum Button {
|
||||
Left,
|
||||
@@ -125,7 +120,7 @@ pub struct CursorModule<Ctx> {
|
||||
}
|
||||
|
||||
impl<Ctx: 'static> UiModule for CursorModule<Ctx> {
|
||||
fn on_draw(&mut self, inst: &WidgetInstance) {
|
||||
fn on_draw(&mut self, inst: &ActiveData) {
|
||||
if self.map.contains_key(&inst.id) {
|
||||
self.active
|
||||
.entry(inst.layer)
|
||||
@@ -134,7 +129,7 @@ impl<Ctx: 'static> UiModule for CursorModule<Ctx> {
|
||||
}
|
||||
}
|
||||
|
||||
fn on_undraw(&mut self, inst: &WidgetInstance) {
|
||||
fn on_undraw(&mut self, inst: &ActiveData) {
|
||||
if let Some(layer) = self.active.get_mut(&inst.layer) {
|
||||
layer.remove(&inst.id);
|
||||
}
|
||||
@@ -147,7 +142,7 @@ impl<Ctx: 'static> UiModule for CursorModule<Ctx> {
|
||||
}
|
||||
}
|
||||
|
||||
fn on_move(&mut self, inst: &WidgetInstance) {
|
||||
fn on_move(&mut self, inst: &ActiveData) {
|
||||
if let Some(map) = self.active.get_mut(&inst.layer)
|
||||
&& let Some(region) = map.get_mut(&inst.id)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user