Merge pull request #76 from nevack/nevack/cleanup-mainwindow

Cleanup dead code in MainWindow and AppController.
CQTexperiment
Christopher Snowhill 2021-01-09 01:59:09 -08:00 committed by GitHub
commit a8fe9d6a2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 48 deletions

View File

@ -33,8 +33,6 @@
IBOutlet NSButton *randomizeButton;
IBOutlet NSTextField *totalTimeField;
IBOutlet NSDrawer *infoDrawer;
IBOutlet PlaylistView *playlistView;
@ -82,10 +80,6 @@
- (IBAction)feedback:(id)sender;
- (IBAction)toggleInfoDrawer:(id)sender;
- (void)drawerDidOpen:(NSNotification *)notification;
- (void)drawerDidClose:(NSNotification *)notification;
- (void)initDefaults;
//Fun stuff

View File

@ -316,27 +316,6 @@
[theApplication replyToOpenOrPrint:NSApplicationDelegateReplySuccess];
}
- (IBAction)toggleInfoDrawer:(id)sender
{
[mainWindow makeKeyAndOrderFront:self];
[infoDrawer toggle:self];
}
- (void)drawerDidOpen:(NSNotification *)notification
{
if ([notification object] == infoDrawer) {
[infoButton setState:NSOnState];
}
}
- (void)drawerDidClose:(NSNotification *)notification
{
if ([notification object] == infoDrawer) {
[infoButton setState:NSOffState];
}
}
- (IBAction)openLiberapayPage:(id)sender
{
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://liberapay.com/kode54"]];

View File

@ -566,6 +566,7 @@
<toolbarItem reference="1533"/>
</defaultToolbarItems>
</toolbar>
<contentBorderThickness minY="22"/>
<connections>
<binding destination="1897" name="title" keyPath="content.display" id="1903">
<dictionary key="options">
@ -576,8 +577,6 @@
</binding>
<outlet property="delegate" destination="226" id="481"/>
<outlet property="initialFirstResponder" destination="207" id="720"/>
<outlet property="itemLionFullscreenToggle" destination="2456" id="5yZ-Jj-awr"/>
<outlet property="itemLionSeparator" destination="2455" id="0p5-i7-wLz"/>
<outlet property="playlistView" destination="206" id="mah-wo-1nd"/>
</connections>
<point key="canvasLocation" x="130.5" y="131"/>
@ -997,10 +996,10 @@
<action selector="decreaseFontSize:" target="226" id="1872"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" hidden="YES" id="2455">
<menuItem isSeparatorItem="YES" id="2455">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Enter Full Screen" hidden="YES" keyEquivalent="f" id="2456">
<menuItem title="Enter Full Screen" keyEquivalent="f" id="2456">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="toggleFullScreen:" target="-1" id="2457"/>

View File

@ -9,8 +9,6 @@
#import <Cocoa/Cocoa.h>
@interface MainWindow : NSWindow {
IBOutlet NSMenuItem * itemLionSeparator;
IBOutlet NSMenuItem * itemLionFullscreenToggle;
IBOutlet NSView *playlistView;
}

View File

@ -13,28 +13,20 @@
- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSWindowStyleMask)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation
{
self = [super initWithContentRect:contentRect styleMask:windowStyle backing:bufferingType defer:deferCreation];
if (self)
{
[self setExcludedFromWindowsMenu:YES];
[self setContentBorderThickness:24.0 forEdge:NSMinYEdge];
self = [super initWithContentRect:contentRect styleMask:windowStyle backing:bufferingType defer:deferCreation];
if (self)
{
[self setExcludedFromWindowsMenu:YES];
[self setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
}
return self;
return self;
}
- (void)awakeFromNib
{
if ([self respondsToSelector:@selector(toggleFullScreen:)])
{
[itemLionSeparator setHidden:NO];
[itemLionFullscreenToggle setHidden:NO];
}
[super awakeFromNib];
[playlistView setNextResponder:self];
[super awakeFromNib];
}
@end