diff --git a/Mac/Controller.h b/Mac/Controller.h index 1fa902c..dc6961d 100644 --- a/Mac/Controller.h +++ b/Mac/Controller.h @@ -16,6 +16,10 @@ #import "NSData+Base64.h" #import "MimeType.h" +@interface NSWindow (FullScreen) +- (BOOL)mn_isFullScreen; +@end + @interface Controller : NSObject { IBOutlet WebView *timelineView; IBOutlet NSWindow *timelineViewWindow; @@ -31,7 +35,10 @@ ViewDelegate *viewDelegate; WebView *oauthView; AccessToken *accessToken; - + NSSplitView *FullscreenMain; + IBOutlet NSMenuItem *MinimizeMenuItem; + IBOutlet NSMenuItem *MentionsWindowMenuItem; + IBOutlet NSMenuItem *TimelineWindowMenuItem; } @property (retain, nonatomic) IBOutlet WebView *timelineView; @@ -48,7 +55,7 @@ @property (retain, nonatomic) IBOutlet ViewDelegate *viewDelegate; @property (retain, nonatomic) WebView *oauthView; @property (retain, nonatomic) AccessToken *accessToken; - +@property (assign) IBOutlet NSSplitView *FullscreenMain; - (void)initOauth; - (void)authentificationSucceded:(id)sender; diff --git a/Mac/Controller.m b/Mac/Controller.m index a7d85fd..a10c714 100644 --- a/Mac/Controller.m +++ b/Mac/Controller.m @@ -11,7 +11,15 @@ #import "PostModel.h" #import "NSData+Base64.h" +@implementation NSWindow (FullScreen) +- (BOOL)mn_isFullScreen +{ + return (([self styleMask] & NSFullScreenWindowMask) == NSFullScreenWindowMask); +} +@end + @implementation Controller +@synthesize FullscreenMain; @synthesize loginViewWindow; @synthesize loginEntityTextField; @synthesize loginActivityIndicator; @@ -423,13 +431,48 @@ [accessToken setString:nil forKey:@"entity"]; } -// Mentions window has been visible +// Mentions window has been visible + Changes for better fullscreen mode - (void)windowDidBecomeKey:(NSNotification *)notification { if ([notification object] == mentionsViewWindow) { - [self unreadMentions:0]; - } + [self unreadMentions:0]; + } + else if (([notification object] == conversationViewWindow) && ((timelineViewWindow.mn_isFullScreen) || (mentionsViewWindow.mn_isFullScreen))) + { + [conversationViewWindow setLevel:NSModalPanelWindowLevel]; + } +} + +- (void)windowWillEnterFullScreen:(NSNotification *)notification +{ + [TimelineWindowMenuItem setEnabled:NO]; + [MentionsWindowMenuItem setEnabled:NO]; + [MinimizeMenuItem setEnabled:NO]; + if ([notification object] == mentionsViewWindow){ + [timelineViewWindow close]; + } else { + [mentionsViewWindow close]; + } + [timelineView removeFromSuperview]; + [mentionsView removeFromSuperview]; + [FullscreenMain addSubview:timelineView]; + [FullscreenMain addSubview:mentionsView]; + [FullscreenMain setFrame:[[[notification object] contentView] bounds]]; + [[[notification object] contentView] addSubview:FullscreenMain]; + [FullscreenMain setPosition:([[[notification object] contentView] bounds].size.width/2) ofDividerAtIndex:0]; +} + +- (void)windowWillExitFullScreen:(NSNotification *)notification +{ + [TimelineWindowMenuItem setEnabled:YES]; + [MentionsWindowMenuItem setEnabled:YES]; + [MinimizeMenuItem setEnabled:YES]; + [timelineView setFrame:[[timelineViewWindow contentView] bounds]]; + [mentionsView setFrame:[[mentionsViewWindow contentView] bounds]]; + [FullscreenMain removeFromSuperview]; + [[timelineViewWindow contentView] addSubview:timelineView]; + [[mentionsViewWindow contentView] addSubview:mentionsView]; } - (void)getTweetUpdates:(id)sender diff --git a/Mac/English.lproj/MainMenu.xib b/Mac/English.lproj/MainMenu.xib index 93a6f20..ce80295 100644 --- a/Mac/English.lproj/MainMenu.xib +++ b/Mac/English.lproj/MainMenu.xib @@ -29,6 +29,7 @@ NSMenu NSMenuItem NSProgressIndicator + NSSplitView NSTextField NSTextFieldCell NSUserDefaultsController @@ -775,6 +776,7 @@ _NSWindowsMenu + YES @@ -874,9 +876,10 @@ - {{0, 0}, {2560, 1418}} + {{0, 0}, {1280, 778}} {10000000000000, 10000000000000} tentia + 128 YES @@ -943,9 +946,10 @@ - {{0, 0}, {2560, 1418}} + {{0, 0}, {1280, 778}} {10000000000000, 10000000000000} mentions + 128 YES @@ -958,7 +962,7 @@ - + 256 YES @@ -988,6 +992,7 @@ {376, 581} + @@ -997,11 +1002,14 @@ {376, 581} + + - {{0, 0}, {2560, 1418}} + {{0, 0}, {1280, 778}} {10000000000000, 10000000000000} conversations + 256 YES @@ -1140,7 +1148,6 @@ {{391, 46}, {75, 32}} - _NS:9 YES @@ -1177,14 +1184,28 @@ _NS:20 - {{0, 0}, {2560, 1418}} + {{0, 0}, {1280, 778}} {10000000000000, 10000000000000} preferences + 256 YES YES + + + 274 + + YES + + {163, 96} + + + _NS:9 + YES + 3 + @@ -1645,6 +1666,38 @@ 643 + + + FullscreenMain + + + + 661 + + + + TimelineWindowMenuItem + + + + 663 + + + + MentionsWindowMenuItem + + + + 664 + + + + MinimizeMenuItem + + + + 665 + makeKeyAndOrderFront: @@ -1653,6 +1706,14 @@ 656 + + + delegate + + + + 662 + checkForUpdates: @@ -2488,6 +2549,14 @@ + + 658 + + + YES + + + @@ -2606,6 +2675,7 @@ 653.IBPluginDependency 654.IBPluginDependency 657.IBPluginDependency + 658.IBPluginDependency 72.IBPluginDependency 73.IBPluginDependency 79.IBPluginDependency @@ -2733,6 +2803,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin @@ -2747,7 +2818,7 @@ - 657 + 665 @@ -2791,6 +2862,10 @@ YES YES + FullscreenMain + MentionsWindowMenuItem + MinimizeMenuItem + TimelineWindowMenuItem conversationView conversationViewWindow globalHotkeyMenuItem @@ -2806,6 +2881,10 @@ YES + NSSplitView + NSMenuItem + NSMenuItem + NSMenuItem WebView NSWindow NSMenuItem @@ -2824,6 +2903,10 @@ YES YES + FullscreenMain + MentionsWindowMenuItem + MinimizeMenuItem + TimelineWindowMenuItem conversationView conversationViewWindow globalHotkeyMenuItem @@ -2839,6 +2922,22 @@ YES + + FullscreenMain + NSSplitView + + + MentionsWindowMenuItem + NSMenuItem + + + MinimizeMenuItem + NSMenuItem + + + TimelineWindowMenuItem + NSMenuItem + conversationView WebView diff --git a/Mac/English.lproj/NewMessageWindow.xib b/Mac/English.lproj/NewMessageWindow.xib index a2204f0..52b2978 100644 --- a/Mac/English.lproj/NewMessageWindow.xib +++ b/Mac/English.lproj/NewMessageWindow.xib @@ -99,7 +99,6 @@ {{257, 2}, {38, 17}} - YES 68157504 @@ -170,6 +169,7 @@ newPost NO 22 + 256 YES diff --git a/Mac/Tentia-Info.plist b/Mac/Tentia-Info.plist index 15dcd0e..fab63ac 100644 --- a/Mac/Tentia-Info.plist +++ b/Mac/Tentia-Info.plist @@ -42,7 +42,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.4.0 + 0.4.1 CFBundleSignature ???? CFBundleURLTypes @@ -57,7 +57,7 @@ CFBundleVersion - 0.4.0 + 0.4.1 LSApplicationCategoryType public.app-category.lifestyle LSMinimumSystemVersion