config: hide gtk tab bar

This commit is contained in:
Yi Ming
2024-11-08 17:43:57 +08:00
parent d47411dfe9
commit af42a1dd0a
2 changed files with 12 additions and 0 deletions

View File

@ -365,6 +365,12 @@ pub fn init(self: *Window, app: *App) !void {
if (self.header) |h| c.gtk_window_set_titlebar(gtk_window, @ptrCast(@alignCast(h))); if (self.header) |h| c.gtk_window_set_titlebar(gtk_window, @ptrCast(@alignCast(h)));
} }
// Hide the tab bar if we don't want it
if (!app.config.@"gtk-tabbar")
if (self.tab_bar) |tab_bar| {
c.gtk_widget_set_visible(@ptrCast(@alignCast(tab_bar)), 0);
} else c.gtk_notebook_set_show_tabs(self.notebook.gtk_notebook, 0);
// Show the window // Show the window
c.gtk_widget_show(window); c.gtk_widget_show(window);
} }

View File

@ -1622,6 +1622,12 @@ keybind: Keybinds = .{},
/// back to `top`. /// back to `top`.
@"gtk-tabs-location": GtkTabsLocation = .top, @"gtk-tabs-location": GtkTabsLocation = .top,
/// Determines whether the GTK tab bar will be visible. The default is true.
///
/// The "toggle_tab_bar" keybind action can be used to create
/// a keybinding to toggle this setting at runtime.
@"gtk-tabbar": bool = true,
/// Determines the appearance of the top and bottom bars when using the /// Determines the appearance of the top and bottom bars when using the
/// adwaita tab bar. This requires `gtk-adwaita` to be enabled (it is /// adwaita tab bar. This requires `gtk-adwaita` to be enabled (it is
/// by default). /// by default).