mirror of
https://github.com/fairyglade/ly.git
synced 2026-03-24 17:26:04 +00:00
Add widget display name to improve logging
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
@@ -12,10 +12,12 @@ const VTable = struct {
|
||||
};
|
||||
|
||||
id: u64,
|
||||
display_name: []const u8,
|
||||
pointer: *anyopaque,
|
||||
vtable: VTable,
|
||||
|
||||
pub fn init(
|
||||
display_name: []const u8,
|
||||
pointer: anytype,
|
||||
comptime deinit_fn: ?fn (ptr: @TypeOf(pointer)) void,
|
||||
comptime realloc_fn: ?fn (ptr: @TypeOf(pointer)) anyerror!void,
|
||||
@@ -86,6 +88,7 @@ pub fn init(
|
||||
|
||||
return .{
|
||||
.id = @intFromPtr(Impl.vtable.draw_fn),
|
||||
.display_name = display_name,
|
||||
.pointer = pointer,
|
||||
.vtable = Impl.vtable,
|
||||
};
|
||||
|
||||
@@ -84,6 +84,7 @@ pub fn deinit(self: *BigLabel) void {
|
||||
|
||||
pub fn widget(self: *BigLabel) Widget {
|
||||
return Widget.init(
|
||||
"BigLabel",
|
||||
self,
|
||||
deinit,
|
||||
null,
|
||||
|
||||
@@ -61,6 +61,7 @@ pub fn init(
|
||||
|
||||
pub fn widget(self: *CenteredBox) Widget {
|
||||
return Widget.init(
|
||||
"CenteredBox",
|
||||
self,
|
||||
null,
|
||||
null,
|
||||
|
||||
@@ -47,6 +47,7 @@ pub fn deinit(self: *InfoLine) void {
|
||||
|
||||
pub fn widget(self: *InfoLine) Widget {
|
||||
return Widget.init(
|
||||
"InfoLine",
|
||||
self,
|
||||
deinit,
|
||||
null,
|
||||
|
||||
@@ -42,6 +42,7 @@ pub fn deinit(self: *Label) void {
|
||||
|
||||
pub fn widget(self: *Label) Widget {
|
||||
return Widget.init(
|
||||
"Label",
|
||||
self,
|
||||
deinit,
|
||||
null,
|
||||
|
||||
@@ -57,6 +57,7 @@ pub fn deinit(self: *Session) void {
|
||||
|
||||
pub fn widget(self: *Session) Widget {
|
||||
return Widget.init(
|
||||
"Session",
|
||||
self,
|
||||
deinit,
|
||||
null,
|
||||
|
||||
@@ -56,6 +56,7 @@ pub fn deinit(self: *Text) void {
|
||||
|
||||
pub fn widget(self: *Text) Widget {
|
||||
return Widget.init(
|
||||
"Text",
|
||||
self,
|
||||
deinit,
|
||||
null,
|
||||
|
||||
@@ -89,6 +89,7 @@ pub fn deinit(self: *UserList) void {
|
||||
|
||||
pub fn widget(self: *UserList) Widget {
|
||||
return Widget.init(
|
||||
"UserList",
|
||||
self,
|
||||
deinit,
|
||||
null,
|
||||
|
||||
Reference in New Issue
Block a user