feat(win32 gui): read fontface and size from gui_config
This commit is contained in:
parent
1acc9b107e
commit
9e4e81eb0d
8 changed files with 61 additions and 14 deletions
|
@ -1,4 +1,5 @@
|
|||
const std = @import("std");
|
||||
const build_options = @import("build_options");
|
||||
const tp = @import("thespian");
|
||||
|
||||
const Plane = @import("renderer").Plane;
|
||||
|
@ -25,7 +26,19 @@ input_namespace: []const u8,
|
|||
|
||||
const Self = @This();
|
||||
|
||||
const menu_commands = &[_][]const u8{
|
||||
const menu_commands = if (build_options.gui) &[_][]const u8{
|
||||
"open_help",
|
||||
"open_file",
|
||||
"open_recent",
|
||||
"open_recent_project",
|
||||
"open_command_palette",
|
||||
"open_config",
|
||||
"open_gui_config",
|
||||
"open_keybind_config",
|
||||
"toggle_input_mode",
|
||||
"change_theme",
|
||||
"quit",
|
||||
} else &[_][]const u8{
|
||||
"open_help",
|
||||
"open_file",
|
||||
"open_recent",
|
||||
|
|
|
@ -378,11 +378,17 @@ const cmds = struct {
|
|||
pub const open_help_meta = .{ .description = "Open help" };
|
||||
|
||||
pub fn open_config(_: *Self, _: Ctx) Result {
|
||||
const file_name = try root.get_config_file_name(@TypeOf(tui.current().config));
|
||||
const file_name = try root.get_config_file_name(@import("config"));
|
||||
try tp.self_pid().send(.{ "cmd", "navigate", .{ .file = file_name } });
|
||||
}
|
||||
pub const open_config_meta = .{ .description = "Edit configuration file" };
|
||||
|
||||
pub fn open_gui_config(_: *Self, _: Ctx) Result {
|
||||
const file_name = try root.get_config_file_name(@import("gui_config"));
|
||||
try tp.self_pid().send(.{ "cmd", "navigate", .{ .file = file_name } });
|
||||
}
|
||||
pub const open_gui_config_meta = .{ .description = "Edit gui configuration file" };
|
||||
|
||||
pub fn create_scratch_buffer(self: *Self, ctx: Ctx) Result {
|
||||
try self.check_all_not_dirty();
|
||||
tui.reset_drag_context();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue