Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/bug #671

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ Please only add new entries below the [Unreleased](#unreleased---releasedate) he

## [@Unreleased] - @ReleaseDate

### Fixed

- **core**: fix set opacity zero no work to it's children. (#671 @wjian23)
- **core**: Fix TextStyle cause providers mismatched (#671 @wjian23)

## [0.4.0-alpha.19] - 2024-12-18

### Features
Expand Down
13 changes: 4 additions & 9 deletions core/src/builtin_widgets/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,10 @@ impl<'c> ComposeChild<'c> for OverrideClass {
let cls_override = this.try_into_value().unwrap_or_else(|_| {
panic!("Attempting to use `OverrideClass` as a reader or writer is not allowed.")
});
let f = move || {
BuildCtx::get_mut()
.current_providers
.push(Box::new(Queryable(cls_override)));
let id = child.build();
BuildCtx::get_mut().current_providers.pop();
Widget::from_id(id)
};
f.into_widget()

Provider::new(Box::new(Queryable(cls_override)))
.with_child(fn_widget! { child })
.into_widget()
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/builtin_widgets/opacity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ impl WrapRender for Opacity {
}

fn paint(&self, host: &dyn Render, ctx: &mut PaintingCtx) {
ctx.painter().apply_alpha(self.opacity);
if self.opacity > 0. {
ctx.painter().apply_alpha(self.opacity);
host.paint(ctx)
}
}
Expand Down
9 changes: 3 additions & 6 deletions core/src/builtin_widgets/text_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@ impl<'c> ComposeChild<'c> for TextStyleWidget {
}
};

let ctx = BuildCtx::get_mut();
ctx.current_providers.push(provider);
child.into_widget().on_build(|id| {
let provider = ctx.current_providers.pop().unwrap();
id.attach_data(provider, ctx.tree_mut());
})
Provider::new(provider)
.with_child(fn_widget! { child })
.into_widget()
}
}

Expand Down
Loading