apprt/gtk-ng: setup tab views in blueprint

This commit is contained in:
Mitchell Hashimoto
2025-07-27 21:28:42 -07:00
parent 92c1f4b0b9
commit 288461fbee

View File

@ -1,6 +1,7 @@
using Gtk 4.0; using Gtk 4.0;
using Adw 1; using Adw 1;
// TODO:gtk-tabs-location
// TODO:gtk-toolbar-style
template $GhosttyWindow: Adw.ApplicationWindow { template $GhosttyWindow: Adw.ApplicationWindow {
styles [ styles [
"window", "window",
@ -18,38 +19,64 @@ template $GhosttyWindow: Adw.ApplicationWindow {
handle-menubar-accel: false; handle-menubar-accel: false;
title: bind (template.active-surface as <$GhosttySurface>).title; title: bind (template.active-surface as <$GhosttySurface>).title;
content: Box { content: Adw.TabOverview tab_overview {
orientation: vertical; enable-new-tab: true;
view: tab_view;
Adw.HeaderBar { Adw.ToolbarView {
visible: bind template.headerbar-visible; top-bar-style: raised;
bottom-bar-style: raised;
title-widget: Adw.WindowTitle { [top]
title: bind (template.active-surface as <$GhosttySurface>).title; Adw.HeaderBar {
}; visible: bind template.headerbar-visible;
[end] title-widget: Adw.WindowTitle {
Gtk.Box { title: bind (template.active-surface as <$GhosttySurface>).title;
Gtk.MenuButton { };
notify::active => $notify_menu_active();
icon-name: "open-menu-symbolic"; [end]
menu-model: main_menu; Gtk.Box {
tooltip-text: _("Main Menu"); Gtk.ToggleButton {
can-focus: false; icon-name: "view-grid-symbolic";
tooltip-text: _("View Open Tabs");
active: bind tab_overview.open bidirectional;
can-focus: false;
focus-on-click: false;
}
Gtk.MenuButton {
notify::active => $notify_menu_active();
icon-name: "open-menu-symbolic";
menu-model: main_menu;
tooltip-text: _("Main Menu");
can-focus: false;
}
} }
} }
}
$GhosttyDebugWarning { [top]
visible: bind template.debug; Adw.TabBar tab_bar {
} view: tab_view;
}
Adw.ToastOverlay toast_overlay { Box {
$GhosttySurface surface { orientation: vertical;
close-request => $surface_close_request();
clipboard-write => $surface_clipboard_write(); $GhosttyDebugWarning {
toggle-fullscreen => $surface_toggle_fullscreen(); visible: bind template.debug;
toggle-maximize => $surface_toggle_maximize(); }
Adw.ToastOverlay toast_overlay {
Adw.TabView tab_view {
$GhosttySurface surface {
close-request => $surface_close_request();
clipboard-write => $surface_clipboard_write();
toggle-fullscreen => $surface_toggle_fullscreen();
toggle-maximize => $surface_toggle_maximize();
}
}
}
} }
} }
}; };