Skip to content

Commit

Permalink
theme: set -> push and unset -> pop
Browse files Browse the repository at this point in the history
  • Loading branch information
foxnne committed Dec 12, 2024
1 parent a5619f8 commit 12d5d09
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
.version = "0.0.1",
.dependencies = .{
.mach = .{
//.path = "../mach-dev/",
.url = "https://pkg.machengine.org/mach/a10cbc34197e8ebcca2ccb1d67e44a2cee186909.tar.gz",
.hash = "1220bd4662837adfb6110a7aa90fe60eebc1e4aba8b3fdfd5c1e366b210257c8a758",
.path = "../mach-dev/",
// .url = "https://pkg.machengine.org/mach/a10cbc34197e8ebcca2ccb1d67e44a2cee186909.tar.gz",
// .hash = "1220bd4662837adfb6110a7aa90fe60eebc1e4aba8b3fdfd5c1e366b210257c8a758",
},
.zig_imgui = .{
//.path = "../zig-imgui/",
.url = "https://github.com/foxnne/zig-imgui/archive/0b4e451da96ce5d24e48bca6d8463ab418c75827.tar.gz",
.hash = "1220ca59c74c701238146166de27e2f0dfe1568b21a138db90875358a2711b5b3ec6",
.path = "../zig-imgui/",
// .url = "https://github.com/foxnne/zig-imgui/archive/0b4e451da96ce5d24e48bca6d8463ab418c75827.tar.gz",
// .hash = "1220ca59c74c701238146166de27e2f0dfe1568b21a138db90875358a2711b5b3ec6",
},
.zstbi = .{
//.path = "../zstbi/",
Expand Down
4 changes: 2 additions & 2 deletions src/Pixi.zig
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,13 @@ pub fn tick(app: *App, core: *Core) !void {

try input.process();

state.theme.set(core, app);
state.theme.push(core, app);

//imgui.showDemoWindow(null);

editor.draw(core);

state.theme.unset();
state.theme.pop();

imgui.render();

Expand Down
4 changes: 2 additions & 2 deletions src/editor/theme.zig
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub fn init(self: Self, core: *mach.Core, pixi: *Pixi) void {
core.windows.set(pixi.window, .decoration_color, .{ .r = fg.x, .g = fg.y, .b = fg.z, .a = fg.w });
}

pub fn set(self: *Self, core: *mach.Core, pixi: *Pixi) void {
pub fn push(self: *Self, core: *mach.Core, pixi: *Pixi) void {
const bg = self.background.toImguiVec4();
const fg = self.foreground.toImguiVec4();
const text = self.text.toImguiVec4();
Expand Down Expand Up @@ -184,7 +184,7 @@ pub fn save(self: Self, path: [:0]const u8) !void {
try std.json.stringify(self, options, out_stream);
}

pub fn unset(self: Self) void {
pub fn pop(self: Self) void {
_ = self;
imgui.popStyleColorEx(28);
}
Expand Down

0 comments on commit 12d5d09

Please sign in to comment.