gtk: fix non-notebook separator colors

This commit is contained in:
Jeffrey C. Ollie
2025-01-02 12:23:05 -06:00
parent b65c26966a
commit a0de1be65f
5 changed files with 6 additions and 2 deletions

View File

@ -99,6 +99,7 @@ pub fn init(self: *Window, app: *App) !void {
self.window = gtk_window; self.window = gtk_window;
c.gtk_window_set_title(gtk_window, "Ghostty"); c.gtk_window_set_title(gtk_window, "Ghostty");
c.gtk_window_set_default_size(gtk_window, 1000, 600); c.gtk_window_set_default_size(gtk_window, 1000, 600);
c.gtk_widget_add_css_class(@ptrCast(gtk_window), "terminal-window");
// GTK4 grabs F10 input by default to focus the menubar icon. We want // GTK4 grabs F10 input by default to focus the menubar icon. We want
// to disable this so that terminal programs can capture F10 (such as htop) // to disable this so that terminal programs can capture F10 (such as htop)

View File

@ -23,6 +23,7 @@ pub const NotebookAdw = struct {
assert(adwaita.enabled(&app.config)); assert(adwaita.enabled(&app.config));
const tab_view: *c.AdwTabView = c.adw_tab_view_new().?; const tab_view: *c.AdwTabView = c.adw_tab_view_new().?;
c.gtk_widget_add_css_class(@ptrCast(@alignCast(tab_view)), "notebook");
if (comptime adwaita.versionAtLeast(1, 2, 0) and adwaita.versionAtLeast(1, 2, 0)) { if (comptime adwaita.versionAtLeast(1, 2, 0) and adwaita.versionAtLeast(1, 2, 0)) {
// Adwaita enables all of the shortcuts by default. // Adwaita enables all of the shortcuts by default.

View File

@ -20,6 +20,8 @@ pub const NotebookGtk = struct {
// Create a notebook to hold our tabs. // Create a notebook to hold our tabs.
const notebook_widget: *c.GtkWidget = c.gtk_notebook_new(); const notebook_widget: *c.GtkWidget = c.gtk_notebook_new();
c.gtk_widget_add_css_class(notebook_widget, "notebook");
const gtk_notebook: *c.GtkNotebook = @ptrCast(notebook_widget); const gtk_notebook: *c.GtkNotebook = @ptrCast(notebook_widget);
const notebook_tab_pos: c_uint = switch (app.config.@"gtk-tabs-location") { const notebook_tab_pos: c_uint = switch (app.config.@"gtk-tabs-location") {
.top, .hidden => c.GTK_POS_TOP, .top, .hidden => c.GTK_POS_TOP,

View File

@ -2,7 +2,7 @@
background-color: transparent; background-color: transparent;
} }
separator { .terminal-window .notebook separator {
background-color: rgba(36, 36, 36, 1); background-color: rgba(36, 36, 36, 1);
background-clip: content-box; background-clip: content-box;
} }

View File

@ -41,7 +41,7 @@ window.without-window-decoration-and-with-titlebar {
background-color: transparent; background-color: transparent;
} }
separator { .terminal-window .notebook separator {
background-color: rgba(250, 250, 250, 1); background-color: rgba(250, 250, 250, 1);
background-clip: content-box; background-clip: content-box;
} }