Make Config a topleve struct
This commit is contained in:
parent
d20d01e596
commit
a03cab94fc
2 changed files with 170 additions and 171 deletions
|
@ -1,35 +1,35 @@
|
|||
const Self = @This();
|
||||
|
||||
const std = @import("std");
|
||||
|
||||
const c = @import("c.zig");
|
||||
const command = @import("command.zig");
|
||||
|
||||
const Server = @import("server.zig");
|
||||
|
||||
pub const Config = struct {
|
||||
const Self = @This();
|
||||
/// Width of borders in pixels
|
||||
border_width: u32,
|
||||
|
||||
/// Width of borders in pixels
|
||||
border_width: u32,
|
||||
/// Amount of view padding in pixels
|
||||
view_padding: u32,
|
||||
|
||||
/// Amount of view padding in pixels
|
||||
view_padding: u32,
|
||||
/// Amount of padding arount the outer edge of the layout in pixels
|
||||
outer_padding: u32,
|
||||
|
||||
/// Amount of padding arount the outer edge of the layout in pixels
|
||||
outer_padding: u32,
|
||||
|
||||
const Keybind = struct {
|
||||
const Keybind = struct {
|
||||
keysym: c.xkb_keysym_t,
|
||||
modifiers: u32,
|
||||
command: command.Command,
|
||||
arg: command.Arg,
|
||||
};
|
||||
};
|
||||
|
||||
/// All user-defined keybindings
|
||||
keybinds: std.ArrayList(Keybind),
|
||||
/// All user-defined keybindings
|
||||
keybinds: std.ArrayList(Keybind),
|
||||
|
||||
/// List of app_ids which will be started floating
|
||||
float_filter: std.ArrayList([*:0]const u8),
|
||||
/// List of app_ids which will be started floating
|
||||
float_filter: std.ArrayList([*:0]const u8),
|
||||
|
||||
pub fn init(self: *Self, allocator: *std.mem.Allocator) !void {
|
||||
pub fn init(self: *Self, allocator: *std.mem.Allocator) !void {
|
||||
self.border_width = 2;
|
||||
self.view_padding = 8;
|
||||
self.outer_padding = 8;
|
||||
|
@ -203,5 +203,4 @@ pub const Config = struct {
|
|||
});
|
||||
|
||||
try self.float_filter.append("float");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ const std = @import("std");
|
|||
|
||||
const c = @import("c.zig");
|
||||
|
||||
const Config = @import("config.zig").Config;
|
||||
const Config = @import("config.zig");
|
||||
const DecorationManager = @import("decoration_manager.zig");
|
||||
const InputManager = @import("input_manager.zig").InputManager;
|
||||
const Log = @import("log.zig").Log;
|
||||
|
|
Loading…
Reference in a new issue