mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-20 03:51:26 +00:00
gtk: move helper function around
This commit is contained in:
committed by
Mitchell Hashimoto
parent
aaa6ff8884
commit
77b8e3c956
@@ -203,6 +203,18 @@ fn addChild2(self: *Paned, child: Child) void {
|
||||
child.setParent(.{ .paned = .{ self, .end } });
|
||||
}
|
||||
|
||||
fn surfaceInPosition(self: *Paned, position: Position) ?*Surface {
|
||||
const child = switch (position) {
|
||||
.start => self.child1,
|
||||
.end => self.child2,
|
||||
};
|
||||
|
||||
return switch (child) {
|
||||
.surface => |surface| surface,
|
||||
else => null,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn deinit(self: *Paned, alloc: Allocator) void {
|
||||
switch (self.child1) {
|
||||
.none, .surface => {},
|
||||
@@ -220,15 +232,3 @@ pub fn deinit(self: *Paned, alloc: Allocator) void {
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
fn surfaceInPosition(self: *Paned, position: Position) ?*Surface {
|
||||
const child = switch (position) {
|
||||
.start => self.child1,
|
||||
.end => self.child2,
|
||||
};
|
||||
|
||||
return switch (child) {
|
||||
.surface => |surface| surface,
|
||||
else => null,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user