apprt/gtk-ng: track is-zoomed property on surface tree
parent
fb846b669c
commit
f130a724e5
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue