mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
MacPDF: Unbreak persisting the current page
I broke this when moving from a xib file to creating the UI in code. https://developer.apple.com/documentation/appkit/nsuserinterfaceitemidentification/1396829-identifier says: "Identifiers are used during window restoration operations to uniquely identify the windows of the application. [...] If you create an item in Interface Builder and do not set a value for this string, a unique value is created for the item when the nib file is loaded. For programmatically created views, you typically set this value after creating the item but before adding it to a window." Without this, encodeRestorableStateWithCoder: / restoreStateWithCoder: in MacPDFView weren't getting called.
This commit is contained in:
parent
a75f876ec0
commit
409eb644c8
1 changed files with 1 additions and 0 deletions
|
@ -33,6 +33,7 @@
|
|||
return nil;
|
||||
|
||||
_pdfView = [[MacPDFView alloc] initWithFrame:NSZeroRect];
|
||||
_pdfView.identifier = @"PDFView"; // To make state restoration work.
|
||||
[_pdfView setDelegate:self];
|
||||
|
||||
NSSplitViewController* split_view = [[NSSplitViewController alloc] initWithNibName:nil bundle:nil];
|
||||
|
|
Loading…
Reference in a new issue