mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 17:26:09 +03:00
apprt/gtk: use GtkWidget so there is a common ancestor
This commit is contained in:
@ -23,8 +23,6 @@ const c = @import("c.zig").c;
|
|||||||
const adwaita = @import("adwaita.zig");
|
const adwaita = @import("adwaita.zig");
|
||||||
const Notebook = @import("./notebook.zig").Notebook;
|
const Notebook = @import("./notebook.zig").Notebook;
|
||||||
|
|
||||||
const HeaderBar = if (adwaita.versionAtLeast(0, 0, 0)) c.AdwHeaderBar else c.GtkHeaderBar;
|
|
||||||
|
|
||||||
const log = std.log.scoped(.gtk);
|
const log = std.log.scoped(.gtk);
|
||||||
|
|
||||||
app: *App,
|
app: *App,
|
||||||
@ -33,8 +31,9 @@ app: *App,
|
|||||||
window: *c.GtkWindow,
|
window: *c.GtkWindow,
|
||||||
|
|
||||||
/// The header bar for the window. This is possibly null since it can be
|
/// The header bar for the window. This is possibly null since it can be
|
||||||
/// disabled using gtk-titlebar.
|
/// disabled using gtk-titlebar. This is either an AdwHeaderBar or
|
||||||
header: ?*HeaderBar,
|
/// GtkHeaderBar depending on if adw is enabled and linked.
|
||||||
|
header: ?*c.GtkWidget,
|
||||||
|
|
||||||
/// The notebook (tab grouping) for this window.
|
/// The notebook (tab grouping) for this window.
|
||||||
/// can be either c.GtkNotebook or c.AdwTabView.
|
/// can be either c.GtkNotebook or c.AdwTabView.
|
||||||
@ -103,7 +102,7 @@ pub fn init(self: *Window, app: *App) !void {
|
|||||||
// are decorated or not because we can have a keybind to toggle the
|
// are decorated or not because we can have a keybind to toggle the
|
||||||
// decorations.
|
// decorations.
|
||||||
if (app.config.@"gtk-titlebar") {
|
if (app.config.@"gtk-titlebar") {
|
||||||
const header: *HeaderBar = if (self.isAdwWindow())
|
const header: *c.GtkWidget = if (self.isAdwWindow())
|
||||||
@ptrCast(c.adw_header_bar_new())
|
@ptrCast(c.adw_header_bar_new())
|
||||||
else
|
else
|
||||||
@ptrCast(c.gtk_header_bar_new());
|
@ptrCast(c.gtk_header_bar_new());
|
||||||
|
Reference in New Issue
Block a user