wgui: Refactoring, various changes (see desc)
- use parking_lot for mutex (less restrictive and easier to use) - simplify event callbacks and widget type casting - defer component initialization at start (required for setting the initial state of sliders) - fix non-working scroll events - update testbed.xml - replace slider with the real one in bar.xml - show slider text on its handle
This commit is contained in:
@@ -1,6 +1,20 @@
|
||||
use crate::any::AnyTrait;
|
||||
use taffy::TaffyTree;
|
||||
|
||||
use crate::{
|
||||
any::AnyTrait,
|
||||
event::EventAlterables,
|
||||
layout::{WidgetID, WidgetMap},
|
||||
};
|
||||
|
||||
pub mod button;
|
||||
pub mod slider;
|
||||
|
||||
pub trait Component: AnyTrait {}
|
||||
pub struct InitData<'a> {
|
||||
pub alterables: &'a mut EventAlterables,
|
||||
pub widgets: &'a WidgetMap,
|
||||
pub tree: &'a TaffyTree<WidgetID>,
|
||||
}
|
||||
|
||||
pub trait Component: AnyTrait {
|
||||
fn init(&self, data: &mut InitData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user