mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 05:31:40 +08:00
39 lines
964 B
Objective-C
39 lines
964 B
Objective-C
//
|
|
// WindowDelegate.m
|
|
// test
|
|
//
|
|
// Created by Lea Anthony on 10/10/21.
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
#import <Cocoa/Cocoa.h>
|
|
#import "WindowDelegate.h"
|
|
#import "message.h"
|
|
#import "WailsContext.h"
|
|
|
|
@implementation WindowDelegate
|
|
|
|
- (BOOL)windowShouldClose:(WailsWindow *)sender {
|
|
[sender orderOut:nil];
|
|
if( self.hideOnClose == false ) {
|
|
processMessage("Q");
|
|
}
|
|
return !self.hideOnClose;
|
|
}
|
|
|
|
|
|
- (void)windowDidExitFullScreen:(NSNotification *)notification {
|
|
[self.ctx.mainWindow applyWindowConstraints];
|
|
}
|
|
|
|
- (void)windowWillEnterFullScreen:(NSNotification *)notification {
|
|
[self.ctx.mainWindow disableWindowConstraints];
|
|
}
|
|
|
|
- (NSApplicationPresentationOptions)window:(WailsWindow *)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions {
|
|
return NSApplicationPresentationAutoHideToolbar | NSApplicationPresentationAutoHideMenuBar | NSApplicationPresentationFullScreen;
|
|
}
|
|
|
|
|
|
@end
|