diff --git a/Clocker.xcodeproj/project.pbxproj b/Clocker.xcodeproj/project.pbxproj index 6d67482..e6ec92d 100755 --- a/Clocker.xcodeproj/project.pbxproj +++ b/Clocker.xcodeproj/project.pbxproj @@ -47,6 +47,7 @@ 9A5B6C7C1D470ECB000EAAF1 /* CLTableViewDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A5B6C7B1D470ECB000EAAF1 /* CLTableViewDataSource.m */; }; 9A5E6BAB1CAF8DFA006E7C5C /* iRate.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 9A5E6BAA1CAF8DFA006E7C5C /* iRate.bundle */; }; 9A63620A1C432F68004AD010 /* CLAPIConnector.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A6362091C432F68004AD010 /* CLAPIConnector.m */; }; + 9A6AAD3F1E2A8268003C826E /* CLUnderlinedButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A6AAD3E1E2A8268003C826E /* CLUnderlinedButton.m */; }; 9A6D93371CF3E82F005A8690 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A6D93361CF3E82F005A8690 /* CoreImage.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 9A79E9901CB34B6800BA7916 /* CLParentPanelController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A79E98F1CB34B6800BA7916 /* CLParentPanelController.m */; }; 9A8605AE1BEC148400A810A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605AD1BEC148400A810A4 /* main.m */; }; @@ -256,6 +257,8 @@ 9A5E6BAA1CAF8DFA006E7C5C /* iRate.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = iRate.bundle; sourceTree = ""; }; 9A6362081C432F68004AD010 /* CLAPIConnector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CLAPIConnector.h; path = Clocker/API/CLAPIConnector.h; sourceTree = ""; }; 9A6362091C432F68004AD010 /* CLAPIConnector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CLAPIConnector.m; path = Clocker/API/CLAPIConnector.m; sourceTree = ""; }; + 9A6AAD3D1E2A8268003C826E /* CLUnderlinedButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CLUnderlinedButton.h; path = Clocker/Utilities/CLUnderlinedButton.h; sourceTree = ""; }; + 9A6AAD3E1E2A8268003C826E /* CLUnderlinedButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CLUnderlinedButton.m; path = Clocker/Utilities/CLUnderlinedButton.m; sourceTree = ""; }; 9A6D93361CF3E82F005A8690 /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; }; 9A79E98E1CB34B6800BA7916 /* CLParentPanelController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CLParentPanelController.h; path = Clocker/CLParentPanelController.h; sourceTree = ""; }; 9A79E98F1CB34B6800BA7916 /* CLParentPanelController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CLParentPanelController.m; path = Clocker/CLParentPanelController.m; sourceTree = ""; }; @@ -475,6 +478,8 @@ 9ABA2B021C671D49009DC0EF /* CLMainWindowController.m */, 9A79E98E1CB34B6800BA7916 /* CLParentPanelController.h */, 9A79E98F1CB34B6800BA7916 /* CLParentPanelController.m */, + 9A6AAD3D1E2A8268003C826E /* CLUnderlinedButton.h */, + 9A6AAD3E1E2A8268003C826E /* CLUnderlinedButton.m */, ); name = Superclass; sourceTree = ""; @@ -860,6 +865,7 @@ 9A392EED1C1CE9950072C10A /* CLPreferencesViewController.m in Sources */, 9A5951BD1C1D0A8D009C17AA /* CommonStrings.m in Sources */, 9A5951FA1C1D5214009C17AA /* iVersion.m in Sources */, + 9A6AAD3F1E2A8268003C826E /* CLUnderlinedButton.m in Sources */, 9A87DAC61C358FA800A8CF3B /* DTError.m in Sources */, 9A20A0781C4EA53600FB45AB /* CLOnboardingWindowController.m in Sources */, 9A5B6C7C1D470ECB000EAAF1 /* CLTableViewDataSource.m in Sources */, diff --git a/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate b/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate index fbd0cf4..8f483e2 100644 Binary files a/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate and b/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Clocker/AboutUsWindow/CLAboutUsViewController.m b/Clocker/AboutUsWindow/CLAboutUsViewController.m index c8effa4..5c0f76a 100644 --- a/Clocker/AboutUsWindow/CLAboutUsViewController.m +++ b/Clocker/AboutUsWindow/CLAboutUsViewController.m @@ -9,11 +9,18 @@ #import "CLAboutUsViewController.h" #import "CommonStrings.h" #import "CLAppFeedbackWindowController.h" +#import "CLUnderlinedButton.h" @interface CLAboutUsViewController () @property (strong, nonatomic) CLAppFeedbackWindowController *feedbackWindow; @property (weak) IBOutlet NSTextField *versionField; +@property (weak) IBOutlet CLUnderlinedButton *makerButton; +@property (weak) IBOutlet CLUnderlinedButton *quickCommentAction; +@property (weak) IBOutlet CLUnderlinedButton *privateFeedback; +@property (weak) IBOutlet CLUnderlinedButton *supportClocker; +@property (weak) IBOutlet CLUnderlinedButton *facebookButton; + @end @@ -22,17 +29,59 @@ NSString *const CLAboutUsNibIdentifier = @"CLAboutWindow"; NSString *const CLGitHubURL = @"https://github.com/Abhishaker17/Clocker"; NSString *const CLIssueURL =@"https://github.com/Abhishaker17/Clocker/issues"; NSString *const CLFacebookPageURL = @"https://www.facebook.com/ClockerMenubarClock/"; +NSString *const CLTwitterLink = @"https://twitter.com/abgbm"; +NSString *const CLPersonalWebsite = @"http://abhishekbanthia.com"; @implementation CLAboutUsViewController - (void)viewDidLoad { [super viewDidLoad]; - self.versionField.stringValue = NSLocalizedFormatString(@"ClockerVersion", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]); + [self underlineTextForActionButton]; + + self.versionField.stringValue = [NSString stringWithFormat:@"Clocker %@", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]]; // Do view setup here. } +- (void)underlineTextForActionButton +{ + NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithAttributedString:self.makerButton.attributedTitle]; + + [str addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInt:NSUnderlineStyleSingle] range:NSMakeRange(3, str.length-3)]; + + [self.makerButton setAttributedTitle:str]; + + NSMutableAttributedString *quickComment = [[NSMutableAttributedString alloc] initWithAttributedString:self.quickCommentAction.attributedTitle]; + + [quickComment addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInt:NSUnderlineStyleSingle] range:NSMakeRange(3, 6)]; + + [self.quickCommentAction setAttributedTitle:quickComment]; + + NSMutableAttributedString *privateFeed = [[NSMutableAttributedString alloc] initWithAttributedString:self.privateFeedback.attributedTitle]; + + [privateFeed addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInt:NSUnderlineStyleSingle] range:NSMakeRange(7, privateFeed.length-7)]; + + [self.privateFeedback setAttributedTitle:privateFeed]; + + NSMutableAttributedString *supportClocker = [[NSMutableAttributedString alloc] initWithAttributedString:self.supportClocker.attributedTitle]; + + [supportClocker addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInt:NSUnderlineStyleSingle] range:NSMakeRange(27, 19)]; + + [self.supportClocker setAttributedTitle:supportClocker]; + + [self.quickCommentAction setCursor:[NSCursor pointingHandCursor]]; + [self.supportClocker setCursor:[NSCursor pointingHandCursor]]; + [self.privateFeedback setCursor:[NSCursor pointingHandCursor]]; + [self.makerButton setCursor:[NSCursor pointingHandCursor]]; + [self.facebookButton setCursor:[NSCursor pointingHandCursor]]; +} + +- (IBAction)openMyTwitter:(id)sender +{ + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:CLTwitterLink]]; +} + - (IBAction)viewSource:(id)sender { [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:CLGitHubURL]]; @@ -50,4 +99,8 @@ NSString *const CLFacebookPageURL = @"https://www.facebook.com/ClockerMenubarClo [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:CLFacebookPageURL]]; } +- (IBAction)openWebsite:(id)sender { + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:CLPersonalWebsite]]; +} + @end diff --git a/Clocker/AboutUsWindow/en.lproj/CLAboutUsView.xib b/Clocker/AboutUsWindow/en.lproj/CLAboutUsView.xib index 57e3082..9396a9e 100644 --- a/Clocker/AboutUsWindow/en.lproj/CLAboutUsView.xib +++ b/Clocker/AboutUsWindow/en.lproj/CLAboutUsView.xib @@ -8,162 +8,157 @@ - + + + + + + - + - - - - - - - - - + - - + + - - + + + + + + + + + + + - + + - - + + - - + + - + + - - + + - - - - - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - + - + diff --git a/Clocker/Utilities/CLUnderlinedButton.h b/Clocker/Utilities/CLUnderlinedButton.h new file mode 100644 index 0000000..1bb1895 --- /dev/null +++ b/Clocker/Utilities/CLUnderlinedButton.h @@ -0,0 +1,15 @@ +// +// CLUnderlinedButton.h +// Clocker +// +// Created by Abhishek Banthia on 1/14/17. +// +// + +#import + +@interface CLUnderlinedButton : NSButton + +@property (strong) NSCursor *cursor; + +@end diff --git a/Clocker/Utilities/CLUnderlinedButton.m b/Clocker/Utilities/CLUnderlinedButton.m new file mode 100644 index 0000000..3d8f5ce --- /dev/null +++ b/Clocker/Utilities/CLUnderlinedButton.m @@ -0,0 +1,28 @@ +// +// CLUnderlinedButton.m +// Clocker +// +// Created by Abhishek Banthia on 1/14/17. +// +// + +#import "CLUnderlinedButton.h" + +@implementation CLUnderlinedButton + +- (void)drawRect:(NSRect)dirtyRect { + [super drawRect:dirtyRect]; + + // Drawing code here. +} + +-(void)resetCursorRects +{ + if (self.cursor) { + [self addCursorRect:[self bounds] cursor: self.cursor]; + } else { + [super resetCursorRects]; + } +} + +@end