mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
gtk: port new-tab behavior over after rebase and refactor
This is the new behavior from #776.
This commit is contained in:

committed by
Mitchell Hashimoto

parent
8c58bf222d
commit
ab93579bf6
@ -100,7 +100,14 @@ pub fn init(self: *Tab, window: *Window, parent_: ?*CoreSurface) !void {
|
|||||||
const gl_area_widget = @as(*c.GtkWidget, @ptrCast(surface.gl_area));
|
const gl_area_widget = @as(*c.GtkWidget, @ptrCast(surface.gl_area));
|
||||||
c.gtk_box_append(self.box, gl_area_widget);
|
c.gtk_box_append(self.box, gl_area_widget);
|
||||||
|
|
||||||
const page_idx = c.gtk_notebook_append_page(window.notebook, box_widget, label_box_widget);
|
// Add the notebook page (create tab). We create the tab after our
|
||||||
|
// current selected tab if we have one.
|
||||||
|
const page_idx = c.gtk_notebook_insert_page(
|
||||||
|
window.notebook,
|
||||||
|
box_widget,
|
||||||
|
label_box_widget,
|
||||||
|
c.gtk_notebook_get_current_page(window.notebook) + 1,
|
||||||
|
);
|
||||||
if (page_idx < 0) {
|
if (page_idx < 0) {
|
||||||
log.warn("failed to add page to notebook", .{});
|
log.warn("failed to add page to notebook", .{});
|
||||||
return error.GtkAppendPageFailed;
|
return error.GtkAppendPageFailed;
|
||||||
|
Reference in New Issue
Block a user