mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
gtk: make sure that window-decoration is honored on all paths
This commit is contained in:

committed by
Jonathan Lopez

parent
c756617aa3
commit
ac61c470ae
@ -156,6 +156,9 @@ pub fn init(self: *Window, app: *App) !void {
|
||||
if (app.config.@"gtk-titlebar") {
|
||||
const header = HeaderBar.init(self);
|
||||
|
||||
// If we are not decorated then we hide the titlebar.
|
||||
header.setVisible(app.config.@"window-decoration");
|
||||
|
||||
{
|
||||
const btn = c.gtk_menu_button_new();
|
||||
c.gtk_widget_set_tooltip_text(btn, "Main Menu");
|
||||
@ -298,11 +301,6 @@ pub fn init(self: *Window, app: *App) !void {
|
||||
if (self.header) |header| {
|
||||
const header_widget = header.asWidget();
|
||||
c.adw_toolbar_view_add_top_bar(toolbar_view, header_widget);
|
||||
|
||||
// If we are not decorated then we hide the titlebar.
|
||||
if (!app.config.@"window-decoration") {
|
||||
c.gtk_widget_set_visible(header_widget, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (self.app.config.@"gtk-tabs-location" != .hidden) {
|
||||
|
@ -30,6 +30,10 @@ pub const HeaderBar = union(enum) {
|
||||
return .{ .gtk = @ptrCast(headerbar) };
|
||||
}
|
||||
|
||||
pub fn setVisible(self: HeaderBar, visible: bool) void {
|
||||
c.gtk_widget_set_visible(self.asWidget(), if (visible) 1 else 0);
|
||||
}
|
||||
|
||||
pub fn asWidget(self: HeaderBar) *c.GtkWidget {
|
||||
return switch (self) {
|
||||
.adw => |headerbar| @ptrCast(@alignCast(headerbar)),
|
||||
|
Reference in New Issue
Block a user