- remove the unused dialog context struct

- set the current title in the input buffer
- fix formatting
This commit is contained in:
Maciej Bartczak
2025-02-21 22:11:32 +01:00
committed by Jeffrey C. Ollie
parent 454a53b3f1
commit cd287b4161

View File

@ -1019,11 +1019,6 @@ fn resolveTitle(self: *Surface, title: [:0]const u8) [:0]const u8 {
title[zoom_title_prefix.len..];
}
const PromptTitleDialogContext = struct {
entry: *c.GtkWidget,
self: *Surface,
};
pub fn promptTitle(self: *Surface) !void {
const window = self.container.window() orelse return;
@ -1033,6 +1028,8 @@ pub fn promptTitle(self: *Surface) !void {
const dialog: *adw.AlertDialog = @ptrCast(builder.getObject("prompt_title_dialog"));
dialog.addResponse("cancel", "Cancel");
dialog.addResponse("ok", "OK");
const entry: *gtk.Entry = @ptrCast(builder.getObject("title_entry"));
entry.getBuffer().setText(self.getTitle() orelse "", -1);
dialog.choose(@ptrCast(window.window), null, @ptrCast(&gtkPromptTitleResponse), self);
}