refactor: prefer Plane.fill for blanking with alpha
This commit is contained in:
parent
fa25d250c6
commit
f7ba83fd83
18 changed files with 20 additions and 20 deletions
|
@ -27,7 +27,7 @@ pub fn Options(context: type) type {
|
|||
self.plane.erase();
|
||||
self.plane.home();
|
||||
self.plane.set_style(style_label);
|
||||
_ = self.plane.fill_width(" ", .{}) catch {};
|
||||
self.plane.fill(" ");
|
||||
self.plane.home();
|
||||
if (self.text.items.len > 0) {
|
||||
_ = self.plane.print(" {s} ", .{self.text.items}) catch {};
|
||||
|
|
|
@ -33,7 +33,7 @@ pub fn Options(context: type) type {
|
|||
button.plane.home();
|
||||
if (button.active or button.hover or selected) {
|
||||
button.plane.set_style(style_label);
|
||||
_ = button.plane.fill_width(" ", .{}) catch {};
|
||||
button.plane.fill(" ");
|
||||
button.plane.home();
|
||||
}
|
||||
_ = button.plane.print(" {s} ", .{button.opts.label}) catch {};
|
||||
|
|
|
@ -155,7 +155,7 @@ fn handle_render_menu(self: *Self, button: *Button.State(*Menu.State(*Self)), th
|
|||
button.plane.home();
|
||||
button.plane.set_style(style_label);
|
||||
if (button.active or button.hover or selected) {
|
||||
_ = button.plane.fill_width(" ", .{}) catch {};
|
||||
button.plane.fill(" ");
|
||||
button.plane.home();
|
||||
}
|
||||
const entry = &self.entries.items[idx];
|
||||
|
|
|
@ -127,7 +127,7 @@ fn menu_on_render(_: *Self, button: *Button.State(*Menu.State(*Self)), theme: *c
|
|||
button.plane.home();
|
||||
button.plane.set_style(style_label);
|
||||
if (button.active or button.hover or selected) {
|
||||
_ = button.plane.fill_width(" ", .{}) catch {};
|
||||
button.plane.fill(" ");
|
||||
button.plane.home();
|
||||
}
|
||||
const style_text = if (tui.find_scope_style(theme, "keyword")) |sty| sty.style else style_label;
|
||||
|
|
|
@ -75,7 +75,7 @@ pub fn on_render_menu(_: *Type, button: *Type.ButtonState, theme: *const Widget.
|
|||
button.plane.home();
|
||||
button.plane.set_style(style_label);
|
||||
if (button.active or button.hover or selected) {
|
||||
_ = button.plane.fill_width(" ", .{}) catch {};
|
||||
button.plane.fill(" ");
|
||||
button.plane.home();
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ fn on_render_menu(_: *Self, button: *Button.State(*Menu.State(*Self)), theme: *c
|
|||
button.plane.home();
|
||||
button.plane.set_style(style_label);
|
||||
if (button.active or button.hover or selected) {
|
||||
_ = button.plane.fill_width(" ", .{}) catch {};
|
||||
button.plane.fill(" ");
|
||||
button.plane.home();
|
||||
}
|
||||
var file_path: []const u8 = undefined;
|
||||
|
|
|
@ -117,7 +117,7 @@ pub fn Create(options: type) type {
|
|||
button.plane.home();
|
||||
button.plane.set_style(style_label);
|
||||
if (button.active or button.hover or selected) {
|
||||
_ = button.plane.fill_width(" ", .{}) catch {};
|
||||
button.plane.fill(" ");
|
||||
button.plane.home();
|
||||
}
|
||||
var label: []const u8 = undefined;
|
||||
|
|
|
@ -39,7 +39,7 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool {
|
|||
self.plane.erase();
|
||||
self.plane.home();
|
||||
self.plane.set_style(theme.statusbar);
|
||||
_ = self.plane.fill_width(" ", .{}) catch {};
|
||||
self.plane.fill(" ");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool {
|
|||
self.plane.erase();
|
||||
self.plane.home();
|
||||
self.plane.set_style(theme.statusbar);
|
||||
_ = self.plane.fill_width(" ", .{}) catch {};
|
||||
self.plane.fill(" ");
|
||||
self.plane.home();
|
||||
|
||||
const now = zeit.instant(.{ .timezone = &self.tz }) catch return false;
|
||||
|
|
|
@ -44,7 +44,7 @@ pub fn render(self: *Self, btn: *Button.State(Self), theme: *const Widget.Theme)
|
|||
btn.plane.erase();
|
||||
btn.plane.home();
|
||||
btn.plane.set_style(bg_style);
|
||||
_ = btn.plane.fill_width(" ", .{}) catch {};
|
||||
btn.plane.fill(" ");
|
||||
btn.plane.home();
|
||||
_ = btn.plane.putstr(self.rendered) catch {};
|
||||
return false;
|
||||
|
|
|
@ -82,11 +82,11 @@ pub fn render(self: *Self, btn: *Button.State(Self), theme: *const Widget.Theme)
|
|||
btn.plane.erase();
|
||||
btn.plane.home();
|
||||
btn.plane.set_style(style_base);
|
||||
_ = btn.plane.fill_width(" ", .{}) catch {};
|
||||
btn.plane.fill(" ");
|
||||
btn.plane.home();
|
||||
btn.plane.set_style(style_label);
|
||||
if (btn.active) {
|
||||
_ = btn.plane.fill_width(" ", .{}) catch {};
|
||||
btn.plane.fill(" ");
|
||||
btn.plane.home();
|
||||
}
|
||||
if (tui.current().mini_mode) |_|
|
||||
|
|
|
@ -39,7 +39,7 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool {
|
|||
self.plane.erase();
|
||||
self.plane.home();
|
||||
self.plane.set_style(theme.statusbar);
|
||||
_ = self.plane.fill_width(" ", .{}) catch {};
|
||||
self.plane.fill(" ");
|
||||
self.plane.home();
|
||||
_ = self.plane.print(" {} ", .{keybind.current_key_event_sequence_fmt()}) catch {};
|
||||
return false;
|
||||
|
|
|
@ -99,7 +99,7 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool {
|
|||
self.plane.erase();
|
||||
self.plane.home();
|
||||
self.plane.set_style(if (self.hover) theme.statusbar_hover else theme.statusbar);
|
||||
_ = self.plane.fill_width(" ", .{}) catch {};
|
||||
self.plane.fill(" ");
|
||||
self.plane.home();
|
||||
return if (self.keys[0].id > 0) self.render_active() else self.render_idle();
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ pub fn render(self: *Self, btn: *Button.State(Self), theme: *const Widget.Theme)
|
|||
btn.plane.erase();
|
||||
btn.plane.home();
|
||||
btn.plane.set_style(if (btn.active) theme.editor_cursor else if (btn.hover) theme.statusbar_hover else theme.statusbar);
|
||||
_ = btn.plane.fill_width(" ", .{}) catch {};
|
||||
btn.plane.fill(" ");
|
||||
btn.plane.home();
|
||||
_ = btn.plane.putstr(self.rendered) catch {};
|
||||
return false;
|
||||
|
|
|
@ -73,7 +73,7 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool {
|
|||
self.plane.erase();
|
||||
self.plane.home();
|
||||
self.plane.set_style(style_normal);
|
||||
_ = self.plane.fill_width(" ", .{}) catch {};
|
||||
self.plane.fill(" ");
|
||||
self.plane.home();
|
||||
self.plane.set_style(if (self.level == .err) style_error else style_info);
|
||||
_ = self.plane.print(" {s} ", .{self.msg.items}) catch {};
|
||||
|
|
|
@ -47,10 +47,10 @@ pub fn render(_: *void, self: *Button.State(void), theme: *const Widget.Theme) b
|
|||
self.plane.erase();
|
||||
self.plane.home();
|
||||
self.plane.set_style(style_base);
|
||||
_ = self.plane.fill_width(" ", .{}) catch {};
|
||||
self.plane.fill(" ");
|
||||
self.plane.home();
|
||||
self.plane.set_style(style_label);
|
||||
_ = self.plane.fill_width(" ", .{}) catch {};
|
||||
self.plane.fill(" ");
|
||||
self.plane.home();
|
||||
self.plane.on_styles(style.bold);
|
||||
var buf: [31:0]u8 = undefined;
|
||||
|
|
|
@ -49,7 +49,7 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool {
|
|||
self.plane.erase();
|
||||
self.plane.home();
|
||||
self.plane.set_style(if (self.hover) theme.statusbar_hover else theme.statusbar);
|
||||
_ = self.plane.fill_width(" ", .{}) catch {};
|
||||
self.plane.fill(" ");
|
||||
self.plane.home();
|
||||
|
||||
_ = self.plane.print(" {s}{s}{s} ", .{
|
||||
|
|
|
@ -43,7 +43,7 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool {
|
|||
self.plane.erase();
|
||||
self.plane.home();
|
||||
self.plane.set_style(theme.statusbar);
|
||||
_ = self.plane.fill_width(" ", .{}) catch {};
|
||||
self.plane.fill(" ");
|
||||
self.plane.home();
|
||||
_ = self.plane.putstr(self.rendered) catch {};
|
||||
return false;
|
||||
|
|
Loading…
Add table
Reference in a new issue