refactor: remove unused parameter in set_base_style

This commit is contained in:
CJ van den Berg 2024-11-04 22:17:08 +01:00
parent 0a43fa853f
commit cfb9f8cf11
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
25 changed files with 28 additions and 28 deletions

View file

@ -35,7 +35,7 @@ pub fn layout(self: *Self) Widget.Layout {
}
pub fn render(self: *Self, theme: *const Widget.Theme) bool {
self.plane.set_base_style(" ", theme.statusbar);
self.plane.set_base_style(theme.statusbar);
self.plane.erase();
return false;
}

View file

@ -59,7 +59,7 @@ pub fn layout(_: *Self) Widget.Layout {
}
pub fn render(self: *Self, theme: *const Widget.Theme) bool {
self.plane.set_base_style(" ", theme.statusbar);
self.plane.set_base_style(theme.statusbar);
self.plane.erase();
self.plane.home();

View file

@ -40,7 +40,7 @@ pub fn layout(self: *Self, _: *Button.State(Self)) Widget.Layout {
pub fn render(self: *Self, btn: *Button.State(Self), theme: *const Widget.Theme) bool {
const bg_style = if (btn.active) theme.editor_cursor else if (btn.hover) theme.statusbar_hover else theme.statusbar;
btn.plane.set_base_style(" ", bg_style);
btn.plane.set_base_style(bg_style);
btn.plane.erase();
btn.plane.home();
_ = btn.plane.putstr(self.rendered) catch {};

View file

@ -78,7 +78,7 @@ pub fn layout(_: *Self, _: *Button.State(Self)) Widget.Layout {
pub fn render(self: *Self, btn: *Button.State(Self), theme: *const Widget.Theme) bool {
const frame = tracy.initZone(@src(), .{ .name = @typeName(@This()) ++ " render" });
defer frame.deinit();
btn.plane.set_base_style(" ", if (btn.active) theme.editor_cursor else theme.statusbar);
btn.plane.set_base_style(if (btn.active) theme.editor_cursor else theme.statusbar);
btn.plane.erase();
btn.plane.home();
if (tui.current().mini_mode) |_|

View file

@ -93,7 +93,7 @@ fn render_idle(self: *Self) bool {
pub fn render(self: *Self, theme: *const Widget.Theme) bool {
const frame = tracy.initZone(@src(), .{ .name = @typeName(@This()) ++ " render" });
defer frame.deinit();
self.plane.set_base_style(" ", if (self.hover) theme.statusbar_hover else theme.statusbar);
self.plane.set_base_style(if (self.hover) theme.statusbar_hover else theme.statusbar);
self.frame += 1;
if (self.frame - self.key_active_frame > self.wipe_after_frames)
self.unset_key_all();

View file

@ -41,7 +41,7 @@ pub fn layout(self: *Self, btn: *Button.State(Self)) Widget.Layout {
}
pub fn render(self: *Self, btn: *Button.State(Self), theme: *const Widget.Theme) bool {
btn.plane.set_base_style(" ", if (btn.active) theme.editor_cursor else if (btn.hover) theme.statusbar_hover else theme.statusbar);
btn.plane.set_base_style(if (btn.active) theme.editor_cursor else if (btn.hover) theme.statusbar_hover else theme.statusbar);
btn.plane.erase();
btn.plane.home();
_ = btn.plane.putstr(self.rendered) catch {};

View file

@ -69,7 +69,7 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool {
const style_normal = theme.statusbar;
const style_info: Widget.Theme.Style = .{ .fg = theme.statusbar.fg, .fs = theme.editor_information.fs };
const style_error: Widget.Theme.Style = .{ .fg = theme.editor_error.fg, .fs = theme.editor_error.fs };
self.plane.set_base_style(" ", style_normal);
self.plane.set_base_style(style_normal);
self.plane.erase();
self.plane.home();
self.plane.set_style(if (self.level == .err) style_error else style_info);

View file

@ -42,7 +42,7 @@ fn is_overlay_mode() bool {
pub fn render(_: *void, self: *Button.State(void), theme: *const Widget.Theme) bool {
const base_style = if (self.active) theme.editor_cursor else if (self.hover) theme.editor_selection else theme.statusbar_hover;
self.plane.set_base_style(" ", base_style);
self.plane.set_base_style(base_style);
self.plane.on_styles(style.bold);
self.plane.erase();
self.plane.home();
@ -52,7 +52,7 @@ pub fn render(_: *void, self: *Button.State(void), theme: *const Widget.Theme) b
} else {
_ = self.plane.putstr(" ") catch {};
}
self.plane.set_base_style(" ", base_style);
self.plane.set_base_style(base_style);
self.plane.on_styles(style.bold);
_ = self.plane.putstr(std.fmt.bufPrintZ(&buf, "{s} ", .{tui.get_mode()}) catch return false) catch {};
if (is_mini_mode())

View file

@ -49,7 +49,7 @@ pub fn layout(_: *Self) Widget.Layout {
pub fn render(self: *Self, theme: *const Widget.Theme) bool {
const frame = tracy.initZone(@src(), .{ .name = @typeName(@This()) ++ " render" });
defer frame.deinit();
self.plane.set_base_style(" ", if (self.hover) theme.statusbar_hover else theme.statusbar);
self.plane.set_base_style(if (self.hover) theme.statusbar_hover else theme.statusbar);
self.plane.erase();
self.plane.home();

View file

@ -39,7 +39,7 @@ pub fn layout(self: *Self) Widget.Layout {
pub fn render(self: *Self, theme: *const Widget.Theme) bool {
const frame = tracy.initZone(@src(), .{ .name = @typeName(@This()) ++ " render" });
defer frame.deinit();
self.plane.set_base_style(" ", theme.statusbar);
self.plane.set_base_style(theme.statusbar);
self.plane.erase();
self.plane.home();
_ = self.plane.putstr(self.rendered) catch {};