This commit is contained in:
Nathan Sobo 2023-08-16 13:52:42 -06:00
parent f1aafab61d
commit 187d78011c
8 changed files with 147 additions and 38 deletions

View file

@ -2879,7 +2879,7 @@ impl<'a, 'b, V> DerefMut for ViewContext<'a, 'b, V> {
}
impl<'a, 'b, V: 'static> ViewContext<'a, 'b, V> {
pub(crate) fn mutable(window_context: &'b mut WindowContext<'a>, view_id: usize) -> Self {
pub fn mutable(window_context: &'b mut WindowContext<'a>, view_id: usize) -> Self {
Self {
window_context: Reference::Mutable(window_context),
view_id,
@ -2887,7 +2887,7 @@ impl<'a, 'b, V: 'static> ViewContext<'a, 'b, V> {
}
}
pub(crate) fn immutable(window_context: &'b WindowContext<'a>, view_id: usize) -> Self {
pub fn immutable(window_context: &'b WindowContext<'a>, view_id: usize) -> Self {
Self {
window_context: Reference::Immutable(window_context),
view_id,
@ -3618,7 +3618,7 @@ pub struct EventContext<'a, 'b, 'c, V> {
}
impl<'a, 'b, 'c, V> EventContext<'a, 'b, 'c, V> {
pub(crate) fn new(view_context: &'c mut ViewContext<'a, 'b, V>) -> Self {
pub fn new(view_context: &'c mut ViewContext<'a, 'b, V>) -> Self {
EventContext {
view_context,
handled: true,

View file

@ -1,5 +1,6 @@
mod mouse_event;
mod mouse_region;
mod region;
#[cfg(debug_assertions)]
use collections::HashSet;

View file

@ -0,0 +1,7 @@
// use crate::geometry::rect::RectF;
// use crate::WindowContext;
// struct Region {
// pub bounds: RectF,
// pub click_handler: Option<Rc<dyn Fn(&dyn Any, MouseEvent, &mut WindowContext)>>,
// }