diff --git a/Meta/Lagom/Contrib/MacPDF/CMakeLists.txt b/Meta/Lagom/Contrib/MacPDF/CMakeLists.txt index b5695ae6fa..8b3ea1bab4 100644 --- a/Meta/Lagom/Contrib/MacPDF/CMakeLists.txt +++ b/Meta/Lagom/Contrib/MacPDF/CMakeLists.txt @@ -10,7 +10,6 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) add_compile_options(-DAK_DONT_REPLACE_STD) set(RESOURCES - MacPDFDocument.xib MainMenu.xib ) diff --git a/Meta/Lagom/Contrib/MacPDF/MacPDFDocument.mm b/Meta/Lagom/Contrib/MacPDF/MacPDFDocument.mm index fa685404ca..bc8ab778d0 100644 --- a/Meta/Lagom/Contrib/MacPDF/MacPDFDocument.mm +++ b/Meta/Lagom/Contrib/MacPDF/MacPDFDocument.mm @@ -81,6 +81,7 @@ { _windowController = [[MacPDFWindowController alloc] initWithDocument:self]; [self addWindowController:_windowController]; + [self windowIsReady]; } - (void)windowIsReady diff --git a/Meta/Lagom/Contrib/MacPDF/MacPDFDocument.xib b/Meta/Lagom/Contrib/MacPDF/MacPDFDocument.xib deleted file mode 100644 index c2768cbc8f..0000000000 --- a/Meta/Lagom/Contrib/MacPDF/MacPDFDocument.xib +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.mm b/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.mm index e22d8c5183..21ddf43193 100644 --- a/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.mm +++ b/Meta/Lagom/Contrib/MacPDF/MacPDFWindowController.mm @@ -19,20 +19,23 @@ - (instancetype)initWithDocument:(MacPDFDocument*)document { - if (self = [super initWithWindowNibName:@"MacPDFDocument" owner:self]; !self) + auto const style_mask = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable; + NSWindow* window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 600, 800) + styleMask:style_mask + backing:NSBackingStoreBuffered + defer:YES]; + + if (self = [super initWithWindow:window]; !self) return nil; + _pdfView = [[MacPDFView alloc] initWithFrame:NSZeroRect]; + window.contentView = _pdfView; + [_pdfView setDelegate:self]; + _pdfDocument = document; return self; } -- (void)windowDidLoad -{ - [super windowDidLoad]; - [_pdfView setDelegate:self]; - [_pdfDocument windowIsReady]; -} - - (void)pdfDidInitialize { [_pdfView setDocument:_pdfDocument.pdf->make_weak_ptr()];