feat: add automatic dark/light mode support
This adds a new configuration option `light_theme` and support for automatically switching the active dark/light theme from terminal events. closes #302
This commit is contained in:
parent
1ade0b1b89
commit
a5d3eb18f3
3 changed files with 68 additions and 22 deletions
|
@ -346,7 +346,9 @@ pub fn process_renderer_event(self: *Self, msg: []const u8) Error!void {
|
|||
if (self.dispatch_event) |f| f(self.handler_ctx, try self.fmtmsg(.{ "system_clipboard", text }));
|
||||
},
|
||||
.color_report => {},
|
||||
.color_scheme => {},
|
||||
.color_scheme => |scheme| {
|
||||
if (self.dispatch_event) |f| f(self.handler_ctx, try self.fmtmsg(.{ "color_scheme", scheme }));
|
||||
},
|
||||
.winsize => |ws| {
|
||||
if (!self.vx.state.in_band_resize) {
|
||||
self.vx.state.in_band_resize = true;
|
||||
|
@ -382,8 +384,11 @@ pub fn process_renderer_event(self: *Self, msg: []const u8) Error!void {
|
|||
self.logger.print("rgb capability detected", .{});
|
||||
self.vx.caps.rgb = true;
|
||||
},
|
||||
.cap_color_scheme_updates => {},
|
||||
|
||||
.cap_color_scheme_updates => {
|
||||
self.logger.print("color scheme updates capability detected", .{});
|
||||
self.vx.caps.color_scheme_updates = true;
|
||||
self.vx.subscribeToColorSchemeUpdates(self.tty.anyWriter()) catch return error.TtyWriteError;
|
||||
},
|
||||
.cap_multi_cursor => {
|
||||
self.logger.print("multi cursor capability detected", .{});
|
||||
self.vx.caps.multi_cursor = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue