Skip to content

Commit

Permalink
minor remain
Browse files Browse the repository at this point in the history
  • Loading branch information
spectria-limina committed Dec 11, 2024
1 parent 1e9fe3e commit c1227f8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ type WidgetSystemId = NestedSystemId<InMut<'static, Ui>>;

#[derive(Debug, Copy, Clone)]
#[derive(Component)]
pub struct WidgetRegistration(WidgetSystemId);
pub struct Widget(WidgetSystemId);

impl WidgetRegistration {
impl Widget {
pub fn show(&self, nested: &mut NestedSystem, ui: &mut Ui) {
nested.run_nested_with(self.0, ui)
}
}

#[derive(Debug, Clone, Component)]

pub struct Widget(fn(&mut World, Entity) -> WidgetSystemId);
pub struct InitWidget(fn(&mut World, Entity) -> WidgetSystemId);

macro_rules! widget {
($show:path) => {
Expand All @@ -66,7 +66,7 @@ macro_rules! widget {
type _ItsNotUnusedISwear = NestedSystemRegistry;

#[derive(Component)]
#[require(Widget(|| widget!(Test::show)))]
#[require(InitWidget(|| widget!(Test::show)))]
struct Test;

impl Test {
Expand Down

0 comments on commit c1227f8

Please sign in to comment.