fix: some minor alpha rendering issues

This commit is contained in:
CJ van den Berg 2024-11-05 10:46:06 +01:00
parent cbcf8cc2dd
commit 486c6ba95e
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
3 changed files with 18 additions and 9 deletions

View file

@ -26,10 +26,16 @@ pub fn Options(context: type) type {
pub fn do_nothing_click(_: **State(Context), _: *Button.State(*State(Context))) void {}
pub fn on_render_default(_: context, button: *Button.State(*State(Context)), theme: *const Widget.Theme, selected: bool) bool {
const style_base = if (button.active) theme.editor_cursor else if (button.hover or selected) theme.editor_selection else theme.editor;
const style_base = theme.editor;
const style_label = if (button.active) theme.editor_cursor else if (button.hover or selected) theme.editor_selection else style_base;
button.plane.set_base_style(style_base);
button.plane.erase();
button.plane.home();
if (button.active or button.hover or selected) {
button.plane.set_style(style_label);
_ = button.plane.fill_width(" ", .{}) catch {};
button.plane.home();
}
_ = button.plane.print(" {s} ", .{button.opts.label}) catch {};
return false;
}