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