mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
apprt/gtk-ng: tab bar top/bottom
This commit is contained in:
@ -187,6 +187,8 @@ pub const Window = extern struct {
|
|||||||
|
|
||||||
// Template bindings
|
// Template bindings
|
||||||
surface: *Surface,
|
surface: *Surface,
|
||||||
|
tab_bar: *adw.TabBar,
|
||||||
|
toolbar: *adw.ToolbarView,
|
||||||
toast_overlay: *adw.ToastOverlay,
|
toast_overlay: *adw.ToastOverlay,
|
||||||
|
|
||||||
pub var offset: c_int = 0;
|
pub var offset: c_int = 0;
|
||||||
@ -287,6 +289,17 @@ pub const Window = extern struct {
|
|||||||
@field(properties, key).impl.param_spec,
|
@field(properties, key).impl.param_spec,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remainder uses the config
|
||||||
|
const priv = self.private();
|
||||||
|
const config = if (priv.config) |v| v.get() else return;
|
||||||
|
|
||||||
|
// Move the tab bar to the proper location.
|
||||||
|
priv.toolbar.remove(priv.tab_bar.as(gtk.Widget));
|
||||||
|
switch (config.@"gtk-tabs-location") {
|
||||||
|
.top => priv.toolbar.addTopBar(priv.tab_bar.as(gtk.Widget)),
|
||||||
|
.bottom => priv.toolbar.addBottomBar(priv.tab_bar.as(gtk.Widget)),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn toggleCssClass(self: *Window, class: [:0]const u8, value: bool) void {
|
fn toggleCssClass(self: *Window, class: [:0]const u8, value: bool) void {
|
||||||
@ -712,6 +725,8 @@ pub const Window = extern struct {
|
|||||||
|
|
||||||
// Bindings
|
// Bindings
|
||||||
class.bindTemplateChildPrivate("surface", .{});
|
class.bindTemplateChildPrivate("surface", .{});
|
||||||
|
class.bindTemplateChildPrivate("tab_bar", .{});
|
||||||
|
class.bindTemplateChildPrivate("toolbar", .{});
|
||||||
class.bindTemplateChildPrivate("toast_overlay", .{});
|
class.bindTemplateChildPrivate("toast_overlay", .{});
|
||||||
|
|
||||||
// Template Callbacks
|
// Template Callbacks
|
||||||
|
@ -23,7 +23,7 @@ template $GhosttyWindow: Adw.ApplicationWindow {
|
|||||||
enable-new-tab: true;
|
enable-new-tab: true;
|
||||||
view: tab_view;
|
view: tab_view;
|
||||||
|
|
||||||
Adw.ToolbarView {
|
Adw.ToolbarView toolbar {
|
||||||
top-bar-style: raised;
|
top-bar-style: raised;
|
||||||
bottom-bar-style: raised;
|
bottom-bar-style: raised;
|
||||||
|
|
||||||
|
@ -142,6 +142,31 @@
|
|||||||
...
|
...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
GDK GLArea
|
||||||
|
Memcheck:Leak
|
||||||
|
match-leak-kinds: possible
|
||||||
|
fun:malloc
|
||||||
|
fun:g_malloc
|
||||||
|
fun:gdk_memory_texture_from_texture
|
||||||
|
fun:gdk_gl_texture_release
|
||||||
|
fun:delete_one_texture
|
||||||
|
fun:g_list_foreach
|
||||||
|
fun:g_list_free_full
|
||||||
|
fun:gtk_gl_area_unrealize
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
GDK GLArea Snapshot
|
||||||
|
Memcheck:Leak
|
||||||
|
match-leak-kinds: definite
|
||||||
|
fun:*alloc
|
||||||
|
...
|
||||||
|
fun:gtk_gl_area_snapshot
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
GSK GPU Rendering
|
GSK GPU Rendering
|
||||||
Memcheck:Leak
|
Memcheck:Leak
|
||||||
|
Reference in New Issue
Block a user