Make Inspector's shortcuts available globally again.

This commit is contained in:
Sergii Stoian 2024-10-05 02:19:48 +03:00
parent e9be2214d2
commit a819f689f3
2 changed files with 24 additions and 1 deletions

View file

@ -23,6 +23,7 @@
* USA.
*/
#include "AppKit/NSApplication.h"
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSSet.h>
@ -33,6 +34,28 @@
#import "GormAppDelegate.h"
#import "GormLanguageViewController.h"
@interface Gorm : NSApplication
@end
@implementation Gorm
/*
NSApplication override to make Inspector's shortcuts available globally
*/
- (void) sendEvent: (NSEvent *)theEvent
{
if ([theEvent type] == NSKeyDown)
{
NSPanel *inspector = [[_delegate inspectorsManager] panel];
if ([inspector performKeyEquivalent: theEvent] != NO)
{
[inspector orderFront: self];
return;
}
}
[super sendEvent: theEvent];
}
@end
@interface GormDocument (Private)
- (NSMutableArray *) _collectAllObjects;

View file

@ -1,7 +1,7 @@
{
NSIcon = "Gorm.tiff";
NSMainNibFile = "Gorm.gorm";
NSPrincipalClass = "NSApplication";
NSPrincipalClass = "Gorm";
NSRole = "Editor";
NSTypes = (