diff --git a/src/apprt/gtk/Window.zig b/src/apprt/gtk/Window.zig index 6d670e1bb..eed24f62e 100644 --- a/src/apprt/gtk/Window.zig +++ b/src/apprt/gtk/Window.zig @@ -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))); } + // 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 c.gtk_widget_show(window); } diff --git a/src/config/Config.zig b/src/config/Config.zig index e6b9d35ab..210298909 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -1622,6 +1622,12 @@ keybind: Keybinds = .{}, /// back to `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 /// adwaita tab bar. This requires `gtk-adwaita` to be enabled (it is /// by default).