mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 09:39:39 +00:00
Everywhere: Move the Ladybird folder to UI
This commit is contained in:
parent
93712b24bf
commit
db47cc41f8
Notes:
github-actions[bot]
2024-11-10 11:51:45 +00:00
Author: https://github.com/trflynn89
Commit: db47cc41f8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
203 changed files with 266 additions and 244 deletions
55
UI/AppKit/Interface/LadybirdWebViewWindow.mm
Normal file
55
UI/AppKit/Interface/LadybirdWebViewWindow.mm
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Tim Flynn <trflynn89@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#import <Interface/LadybirdWebView.h>
|
||||
#import <Interface/LadybirdWebViewWindow.h>
|
||||
|
||||
#if !__has_feature(objc_arc)
|
||||
# error "This project requires ARC"
|
||||
#endif
|
||||
|
||||
@interface LadybirdWebViewWindow ()
|
||||
@end
|
||||
|
||||
@implementation LadybirdWebViewWindow
|
||||
|
||||
- (instancetype)initWithWebView:(LadybirdWebView*)web_view
|
||||
windowRect:(NSRect)window_rect
|
||||
{
|
||||
static constexpr auto style_mask = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable;
|
||||
|
||||
self = [super initWithContentRect:window_rect
|
||||
styleMask:style_mask
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:NO];
|
||||
|
||||
if (self) {
|
||||
self.web_view = web_view;
|
||||
|
||||
if (self.web_view == nil)
|
||||
self.web_view = [[LadybirdWebView alloc] init:nil];
|
||||
|
||||
[self.web_view setClipsToBounds:YES];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - NSWindow
|
||||
|
||||
- (void)setIsVisible:(BOOL)flag
|
||||
{
|
||||
[self.web_view handleVisibility:flag];
|
||||
[super setIsVisible:flag];
|
||||
}
|
||||
|
||||
- (void)setIsMiniaturized:(BOOL)flag
|
||||
{
|
||||
[self.web_view handleVisibility:!flag];
|
||||
[super setIsMiniaturized:flag];
|
||||
}
|
||||
|
||||
@end
|
Loading…
Add table
Add a link
Reference in a new issue