apprt/gtk-ng: new tab button

This commit is contained in:
Mitchell Hashimoto
2025-07-29 10:22:15 -07:00
parent b475cd28d5
commit ccc8dac0a5
3 changed files with 8 additions and 2 deletions

View File

@ -616,6 +616,10 @@ pub const Window = extern struct {
//--------------------------------------------------------------- //---------------------------------------------------------------
// Signal handlers // Signal handlers
fn btnNewTab(_: *adw.SplitButton, self: *Window) callconv(.c) void {
self.performBindingAction(.new_tab);
}
fn windowCloseRequest( fn windowCloseRequest(
_: *gtk.Window, _: *gtk.Window,
self: *Self, self: *Self,
@ -1087,6 +1091,7 @@ pub const Window = extern struct {
class.bindTemplateChildPrivate("toast_overlay", .{}); class.bindTemplateChildPrivate("toast_overlay", .{});
// Template Callbacks // Template Callbacks
class.bindTemplateCallback("new_tab", &btnNewTab);
class.bindTemplateCallback("close_request", &windowCloseRequest); class.bindTemplateCallback("close_request", &windowCloseRequest);
class.bindTemplateCallback("close_page", &tabViewClosePage); class.bindTemplateCallback("close_page", &tabViewClosePage);
class.bindTemplateCallback("page_attached", &tabViewPageAttached); class.bindTemplateCallback("page_attached", &tabViewPageAttached);

View File

@ -35,6 +35,7 @@ template $GhosttyWindow: Adw.ApplicationWindow {
[start] [start]
Adw.SplitButton { Adw.SplitButton {
clicked => $new_tab();
icon-name: "tab-new-symbolic"; icon-name: "tab-new-symbolic";
tooltip-text: _("New Tab"); tooltip-text: _("New Tab");
dropdown-tooltip: _("New Split"); dropdown-tooltip: _("New Split");

View File

@ -146,8 +146,8 @@
GDK GLArea GDK GLArea
Memcheck:Leak Memcheck:Leak
match-leak-kinds: possible match-leak-kinds: possible
fun:malloc fun:*alloc
fun:g_malloc ...
fun:gdk_memory_texture_from_texture fun:gdk_memory_texture_from_texture
fun:gdk_gl_texture_release fun:gdk_gl_texture_release
fun:delete_one_texture fun:delete_one_texture