mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 16:26:08 +03:00
apprt/gtk: add deinit for url widget
This commit is contained in:
@ -270,6 +270,11 @@ pub const URLWidget = struct {
|
||||
};
|
||||
}
|
||||
|
||||
pub fn deinit(self: *URLWidget, overlay: *c.GtkOverlay) void {
|
||||
c.gtk_overlay_remove_overlay(@ptrCast(overlay), @ptrCast(self.left));
|
||||
c.gtk_overlay_remove_overlay(@ptrCast(overlay), @ptrCast(self.right));
|
||||
}
|
||||
|
||||
pub fn setText(self: *const URLWidget, str: [:0]const u8) void {
|
||||
c.gtk_label_set_text(@ptrCast(self.left), str.ptr);
|
||||
c.gtk_label_set_text(@ptrCast(self.right), str.ptr);
|
||||
@ -982,7 +987,7 @@ pub fn setMouseVisibility(self: *Surface, visible: bool) void {
|
||||
|
||||
pub fn mouseOverLink(self: *Surface, uri_: ?[]const u8) void {
|
||||
const uri = uri_ orelse {
|
||||
if (self.url_widget) |widget| {
|
||||
if (self.url_widget) |*widget| {
|
||||
widget.deinit(self.overlay);
|
||||
self.url_widget = null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user