Compare commits

..

No commits in common. "e6cc1c35f9dfce5f3ae0fc64ca7d57c7586e00a2" and "11d086945d5a971e82e9e76f2d0794fd772299eb" have entirely different histories.

2 changed files with 2 additions and 4 deletions

View file

@ -30,7 +30,6 @@ direction: Direction,
deco_box: Widget.Box, deco_box: Widget.Box,
ctx: ?*anyopaque = null, ctx: ?*anyopaque = null,
on_render: *const fn (ctx: ?*anyopaque, theme: *const Widget.Theme) void = on_render_default, on_render: *const fn (ctx: ?*anyopaque, theme: *const Widget.Theme) void = on_render_default,
render_decoration: ?*const fn (self: *Self, theme: *const Widget.Theme, widget_style: *const Widget.Style) void = render_decoration_default,
after_render: *const fn (ctx: ?*anyopaque, theme: *const Widget.Theme) void = on_render_default, after_render: *const fn (ctx: ?*anyopaque, theme: *const Widget.Theme) void = on_render_default,
prepare_resize: *const fn (ctx: ?*anyopaque, self: *Self, box: Widget.Box) Widget.Box = prepare_resize_default, prepare_resize: *const fn (ctx: ?*anyopaque, self: *Self, box: Widget.Box) Widget.Box = prepare_resize_default,
after_resize: *const fn (ctx: ?*anyopaque, self: *Self, box: Widget.Box) void = after_resize_default, after_resize: *const fn (ctx: ?*anyopaque, self: *Self, box: Widget.Box) void = after_resize_default,
@ -173,7 +172,7 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool {
}; };
self.on_render(self.ctx, theme); self.on_render(self.ctx, theme);
if (self.render_decoration) |render_decoration| render_decoration(self, theme, widget_style); self.render_decoration(theme, widget_style);
const client_box = self.to_client_box(self.deco_box, padding); const client_box = self.to_client_box(self.deco_box, padding);
@ -193,7 +192,7 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool {
fn on_render_default(_: ?*anyopaque, _: *const Widget.Theme) void {} fn on_render_default(_: ?*anyopaque, _: *const Widget.Theme) void {}
fn render_decoration_default(self: *Self, theme: *const Widget.Theme, widget_style: *const Widget.Style) void { fn render_decoration(self: *Self, theme: *const Widget.Theme, widget_style: *const Widget.Style) void {
const style = Widget.Style.theme_style_from_type(self.widget_type, theme); const style = Widget.Style.theme_style_from_type(self.widget_type, theme);
const padding = widget_style.padding; const padding = widget_style.padding;
const border = widget_style.border; const border = widget_style.border;

View file

@ -100,7 +100,6 @@ pub const TabBar = struct {
fn init(allocator: std.mem.Allocator, parent: Plane, event_handler: ?EventHandler, min_tabs: ?usize) !Self { fn init(allocator: std.mem.Allocator, parent: Plane, event_handler: ?EventHandler, min_tabs: ?usize) !Self {
var w = try WidgetList.createH(allocator, parent, "tabs", .dynamic); var w = try WidgetList.createH(allocator, parent, "tabs", .dynamic);
w.render_decoration = null;
w.ctx = w; w.ctx = w;
const tab_style, const tab_style_bufs = root.read_config(Style, allocator); const tab_style, const tab_style_bufs = root.read_config(Style, allocator);
return .{ return .{