apprt/gtk-ng: track is-zoomed property on surface tree

pull/8217/head
Mitchell Hashimoto 2025-08-12 13:39:34 -07:00
parent fb846b669c
commit f130a724e5
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
1 changed files with 25 additions and 0 deletions

View File

@ -79,6 +79,25 @@ pub const SplitTree = extern struct {
);
};
pub const @"is-zoomed" = struct {
pub const name = "is-zoomed";
const impl = gobject.ext.defineProperty(
name,
Self,
bool,
.{
.default = false,
.accessor = gobject.ext.typedAccessor(
Self,
bool,
.{
.getter = getIsZoomed,
},
),
},
);
};
pub const tree = struct {
pub const name = "tree";
const impl = gobject.ext.defineProperty(
@ -430,6 +449,11 @@ pub const SplitTree = extern struct {
return !tree.isEmpty();
}
pub fn getIsZoomed(self: *Self) bool {
const tree: *const Surface.Tree = self.private().tree orelse &.empty;
return tree.zoomed != null;
}
/// Get the tree data model that we're showing in this widget. This
/// does not clone the tree.
pub fn getTree(self: *Self) ?*Surface.Tree {
@ -799,6 +823,7 @@ pub const SplitTree = extern struct {
// Dependent properties
self.as(gobject.Object).notifyByPspec(properties.@"has-surfaces".impl.param_spec);
self.as(gobject.Object).notifyByPspec(properties.@"is-zoomed".impl.param_spec);
}
fn onRebuild(ud: ?*anyopaque) callconv(.c) c_int {