Skip to content

Commit

Permalink
gtk: fix non-notebook separator colors
Browse files Browse the repository at this point in the history
  • Loading branch information
jcollie committed Jan 2, 2025
1 parent 80c3833 commit 72e95f0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/apprt/gtk/Window.zig
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ pub fn init(self: *Window, app: *App) !void {
self.window = gtk_window;
c.gtk_window_set_title(gtk_window, "Ghostty");
c.gtk_window_set_default_size(gtk_window, 1000, 600);
c.gtk_widget_add_css_class(@ptrCast(gtk_window), "ghostty");

// 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)
Expand Down
3 changes: 3 additions & 0 deletions src/apprt/gtk/notebook.zig
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ pub const Notebook = union(enum) {

// Create a notebook to hold our tabs.
const notebook_widget: *c.GtkWidget = c.gtk_notebook_new();
c.gtk_widget_add_css_class(notebook_widget, "notebook");

const notebook: *c.GtkNotebook = @ptrCast(notebook_widget);
const notebook_tab_pos: c_uint = switch (app.config.@"gtk-tabs-location") {
.top, .hidden => c.GTK_POS_TOP,
Expand Down Expand Up @@ -65,6 +67,7 @@ pub const Notebook = union(enum) {
assert(adwaita.enabled(&app.config));

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)) {
// Adwaita enables all of the shortcuts by default.
Expand Down
2 changes: 1 addition & 1 deletion src/apprt/gtk/style-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
background-color: transparent;
}

separator {
.ghostty .notebook separator {
background-color: rgba(36, 36, 36, 1);
background-clip: content-box;
}
2 changes: 1 addition & 1 deletion src/apprt/gtk/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ window.without-window-decoration-and-with-titlebar {
background-color: transparent;
}

separator {
.ghostty .notebook separator {
background-color: rgba(250, 250, 250, 1);
background-clip: content-box;
}

0 comments on commit 72e95f0

Please sign in to comment.