mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00

* update zig * pkg/fontconfig: clean up @as * pkg/freetype,harfbuzz: clean up @as * pkg/imgui: clean up @as * pkg/macos: clean up @as * pkg/pixman,utf8proc: clean up @as * clean up @as * lots more @as cleanup * undo flatpak changes * clean up @as
33 lines
807 B
Zig
33 lines
807 B
Zig
const std = @import("std");
|
|
const c = @import("c.zig");
|
|
const Allocator = std.mem.Allocator;
|
|
|
|
pub const Style = opaque {
|
|
pub fn get() Allocator.Error!*Style {
|
|
return @as(
|
|
?*Style,
|
|
@ptrCast(c.igGetStyle()),
|
|
) orelse Allocator.Error.OutOfMemory;
|
|
}
|
|
|
|
pub fn colorsDark(self: *Style) void {
|
|
c.igStyleColorsDark(self.cval());
|
|
}
|
|
|
|
pub fn colorsLight(self: *Style) void {
|
|
c.igStyleColorsLight(self.cval());
|
|
}
|
|
|
|
pub fn colorsClassic(self: *Style) void {
|
|
c.igStyleColorsClassic(self.cval());
|
|
}
|
|
|
|
pub fn scaleAllSizes(self: *Style, factor: f32) void {
|
|
c.ImGuiStyle_ScaleAllSizes(self.cval(), factor);
|
|
}
|
|
|
|
pub inline fn cval(self: *Style) *c.ImGuiStyle {
|
|
return @ptrCast(@alignCast(self));
|
|
}
|
|
};
|