mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
apprt/gtk: add ability to put tabs in the headerbar
Signed-off-by: Tristan Partin <tristan@partin.io>
This commit is contained in:
@ -289,6 +289,10 @@ pub fn init(self: *Window, app: *App) !void {
|
|||||||
// left and right is not supported in libadwaita.
|
// left and right is not supported in libadwaita.
|
||||||
.top, .left, .right => c.adw_toolbar_view_add_top_bar(toolbar_view, tab_bar_widget),
|
.top, .left, .right => c.adw_toolbar_view_add_top_bar(toolbar_view, tab_bar_widget),
|
||||||
.bottom => c.adw_toolbar_view_add_bottom_bar(toolbar_view, tab_bar_widget),
|
.bottom => c.adw_toolbar_view_add_bottom_bar(toolbar_view, tab_bar_widget),
|
||||||
|
.headerbar => {
|
||||||
|
c.adw_tab_bar_set_autohide(tab_bar, 0);
|
||||||
|
c.adw_header_bar_set_title_widget(@ptrCast(@alignCast(self.header.?)), tab_bar_widget);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
c.adw_toolbar_view_set_content(toolbar_view, box);
|
c.adw_toolbar_view_set_content(toolbar_view, box);
|
||||||
|
|
||||||
@ -334,6 +338,7 @@ pub fn init(self: *Window, app: *App) !void {
|
|||||||
.top,
|
.top,
|
||||||
.left,
|
.left,
|
||||||
.right,
|
.right,
|
||||||
|
.headerbar,
|
||||||
=> c.gtk_box_prepend(
|
=> c.gtk_box_prepend(
|
||||||
@ptrCast(box),
|
@ptrCast(box),
|
||||||
@ptrCast(@alignCast(tab_bar)),
|
@ptrCast(@alignCast(tab_bar)),
|
||||||
|
@ -29,7 +29,7 @@ pub const Notebook = union(enum) {
|
|||||||
const notebook_widget: *c.GtkWidget = c.gtk_notebook_new();
|
const notebook_widget: *c.GtkWidget = c.gtk_notebook_new();
|
||||||
const notebook: *c.GtkNotebook = @ptrCast(notebook_widget);
|
const 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 => c.GTK_POS_TOP,
|
.top, .headerbar => c.GTK_POS_TOP,
|
||||||
.bottom => c.GTK_POS_BOTTOM,
|
.bottom => c.GTK_POS_BOTTOM,
|
||||||
.left => c.GTK_POS_LEFT,
|
.left => c.GTK_POS_LEFT,
|
||||||
.right => c.GTK_POS_RIGHT,
|
.right => c.GTK_POS_RIGHT,
|
||||||
|
@ -4511,6 +4511,7 @@ pub const GtkTabsLocation = enum {
|
|||||||
bottom,
|
bottom,
|
||||||
left,
|
left,
|
||||||
right,
|
right,
|
||||||
|
headerbar,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// See adw-toolbar-style
|
/// See adw-toolbar-style
|
||||||
|
Reference in New Issue
Block a user