Skip to content

Optimize rounding of the welcome window #462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 6 additions & 24 deletions GitUp/Application/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@

#define kPreferencePaneIdentifier_General @"general"

#define kWelcomeWindowCornerRadius 10

#define kInstallerName @"install.sh"
#define kToolName @"gitup"
#define kToolInstallPath @"/usr/local/bin/" kToolName
Expand All @@ -45,33 +43,21 @@ @interface NSSavePanel (OSX_10_9)
- (void)setShowsTagField:(BOOL)flag;
@end

@interface WelcomeView : NSView
@end

@interface AppDelegate () <NSUserNotificationCenterDelegate, SUUpdaterDelegate>
- (IBAction)closeWelcomeWindow:(id)sender;
@end

@implementation WelcomeView

- (void)drawRect:(NSRect)dirtyRect {
NSRect bounds = self.bounds;
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];

CGContextClearRect(context, dirtyRect);

CGContextSetRGBFillColor(context, 0.9, 0.9, 0.9, 1.0);
GICGContextAddRoundedRect(context, bounds, kWelcomeWindowCornerRadius);
CGContextFillPath(context);
}

@end

@interface WelcomeWindow : NSWindow
@end

@implementation WelcomeWindow

- (void)awakeFromNib {
self.opaque = NO;
self.backgroundColor = [NSColor clearColor];
self.movableByWindowBackground = YES;
}

- (BOOL)validateMenuItem:(NSMenuItem*)menuItem {
return menuItem.action == @selector(performClose:) ? YES : [super validateMenuItem:menuItem];
}
Expand Down Expand Up @@ -267,10 +253,6 @@ - (void)awakeFromNib {

_allowWelcome = -1;

_welcomeWindow.alphaValue = 1.0;
_welcomeWindow.opaque = NO;
_welcomeWindow.movableByWindowBackground = YES;

_twitterButton.textAlignment = NSLeftTextAlignment;
_twitterButton.textFont = [NSFont boldSystemFontOfSize:11];
_forumsButton.textAlignment = NSLeftTextAlignment;
Expand Down
Loading