mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 08:16:13 +03:00
apprt/gtk: create new tab after current tab
This behaves the same as macOS, and personally I prefer this behavior because when I create a new tab, it is often contextual to what I'm currently working on and keeping the tab nearby feels right.
This commit is contained in:
@ -219,7 +219,15 @@ pub fn newTab(self: *Window, parent_: ?*CoreSurface) !void {
|
|||||||
.parent = parent_ != null,
|
.parent = parent_ != null,
|
||||||
});
|
});
|
||||||
errdefer surface.deinit();
|
errdefer surface.deinit();
|
||||||
const page_idx = c.gtk_notebook_append_page(self.notebook, gl_area, 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(
|
||||||
|
self.notebook,
|
||||||
|
gl_area,
|
||||||
|
label_box_widget,
|
||||||
|
c.gtk_notebook_get_current_page(self.notebook) + 1,
|
||||||
|
);
|
||||||
if (page_idx < 0) {
|
if (page_idx < 0) {
|
||||||
log.warn("failed to add surface to notebook", .{});
|
log.warn("failed to add surface to notebook", .{});
|
||||||
return error.GtkAppendPageFailed;
|
return error.GtkAppendPageFailed;
|
||||||
|
Reference in New Issue
Block a user