MacPDF: Pre-populate "Go to Page..." dialog with current page

This commit is contained in:
Nico Weber 2023-09-24 22:03:36 -04:00 committed by Andreas Kling
parent e67d8cfb2a
commit d2bda064da

View file

@ -152,11 +152,11 @@
[alert addButtonWithTitle:@"Go"];
[alert addButtonWithTitle:@"Cancel"];
// FIXME: Pre-populate with current page.
auto textField = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 24)];
NSNumberFormatter* formatter = [[NSNumberFormatter alloc] init];
formatter.numberStyle = NSNumberFormatterNoStyle; // Integers only.
[textField setFormatter:formatter];
[textField setIntValue:[_pdfView page]];
alert.accessoryView = textField;
alert.window.initialFirstResponder = textField;