apprt/gtk: support window-theme != ghostty

- support for gtk-tabs-location=bottom
 - support for gtk-titlebar=false
This commit is contained in:
Paul
2024-09-24 08:10:06 +02:00
parent 38db305d29
commit b41f45d7a3
2 changed files with 8 additions and 1 deletions

View File

@ -443,7 +443,9 @@ fn loadRuntimeCss(config: *const Config, provider: *c.GtkCssProvider) !void {
\\ opacity: {d:.2};
\\ background-color: rgb({d},{d},{d});
\\}}
\\.top-bar {{
\\window.window-theme-ghostty .top-bar,
\\window.window-theme-ghostty .bottom-bar,
\\window.window-theme-ghostty box > tabbar {{
\\ background-color: rgb({d},{d},{d});
\\ color: rgb({d},{d},{d});
\\}}

View File

@ -95,6 +95,11 @@ pub fn init(self: *Window, app: *App) !void {
c.gtk_window_set_icon_name(gtk_window, "com.mitchellh.ghostty");
// Apply class to color headerbar if window-theme is set to `ghostty`.
if (app.config.@"window-theme" == .ghostty) {
c.gtk_widget_add_css_class(@ptrCast(gtk_window), "window-theme-ghostty");
}
// Remove the window's background if any of the widgets need to be transparent
if (app.config.@"background-opacity" < 1) {
c.gtk_widget_remove_css_class(@ptrCast(window), "background");