refactor: tweak layout of modstate widget

This commit is contained in:
CJ van den Berg 2024-10-31 22:17:21 +01:00
parent 05f5650456
commit 018936bc56
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -21,7 +21,7 @@ hover: bool = false,
const Self = @This();
pub const width = 5;
pub const width = 8;
pub fn create(allocator: Allocator, parent: Plane, _: ?EventHandler) @import("widget.zig").CreateError!Widget {
const self: *Self = try allocator.create(Self);
@ -53,10 +53,10 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool {
self.plane.erase();
self.plane.home();
_ = self.plane.print("\u{2003}{s}{s}{s}\u{2003}", .{
mode(self.ctrl, "", "🅒"),
mode(self.shift, "", "🅢"),
mode(self.alt, "", "🅐"),
_ = self.plane.print(" {s}{s}{s} ", .{
mode(self.ctrl, " ", "🅒 "),
mode(self.shift, " ", "🅢 "),
mode(self.alt, " ", "🅐 "),
}) catch {};
return false;
}