mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +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
66
UI/AppKit/Interface/InspectorController.mm
Normal file
66
UI/AppKit/Interface/InspectorController.mm
Normal file
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#import <Interface/Inspector.h>
|
||||
#import <Interface/InspectorController.h>
|
||||
#import <Interface/LadybirdWebView.h>
|
||||
#import <Interface/Tab.h>
|
||||
|
||||
#if !__has_feature(objc_arc)
|
||||
# error "This project requires ARC"
|
||||
#endif
|
||||
|
||||
@interface InspectorController () <NSWindowDelegate>
|
||||
|
||||
@property (nonatomic, strong) Tab* tab;
|
||||
|
||||
@end
|
||||
|
||||
@implementation InspectorController
|
||||
|
||||
- (instancetype)init:(Tab*)tab
|
||||
{
|
||||
if (self = [super init]) {
|
||||
self.tab = tab;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private methods
|
||||
|
||||
- (Inspector*)inspector
|
||||
{
|
||||
return (Inspector*)[self window];
|
||||
}
|
||||
|
||||
#pragma mark - NSWindowController
|
||||
|
||||
- (IBAction)showWindow:(id)sender
|
||||
{
|
||||
self.window = [[Inspector alloc] init:self.tab];
|
||||
[self.window setDelegate:self];
|
||||
[self.window makeKeyAndOrderFront:sender];
|
||||
}
|
||||
|
||||
#pragma mark - NSWindowDelegate
|
||||
|
||||
- (void)windowWillClose:(NSNotification*)notification
|
||||
{
|
||||
[self.tab onInspectorClosed];
|
||||
}
|
||||
|
||||
- (void)windowDidResize:(NSNotification*)notification
|
||||
{
|
||||
[[[self inspector] web_view] handleResize];
|
||||
}
|
||||
|
||||
- (void)windowDidChangeBackingProperties:(NSNotification*)notification
|
||||
{
|
||||
[[[self inspector] web_view] handleDevicePixelRatioChange];
|
||||
}
|
||||
|
||||
@end
|
Loading…
Add table
Add a link
Reference in a new issue