Skip to content

Commit

Permalink
Lazy fix for lion controls setup animation issues. (Fixes #825).
Browse files Browse the repository at this point in the history
  • Loading branch information
admin authored and admin committed Jan 3, 2014
1 parent a28b752 commit 4e59b67
Show file tree
Hide file tree
Showing 4 changed files with 3,748 additions and 723 deletions.
12 changes: 10 additions & 2 deletions OpenEmu/OEControlsButtonSetupView.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#import <OpenEmuSystem/OpenEmuSystem.h>

#import "NSArray+OEAdditions.h"
#import "OEUtilities.h"

NSString * const OEControlsButtonHighlightRollsOver = @"ButtonHighlightRollsOver";

Expand Down Expand Up @@ -179,11 +180,11 @@ - (void)setupSubviews
for(NSArray *group in groups)
for(NSUInteger j = 0; j < [group count]; j += 2)
{
id item = [group objectAtIndex:j];
NSView *item = [group objectAtIndex:j];
[self addSubview:item];

// handle headline cell
if([item isKindOfClass:[NSTextField class]] && [[item cell] isKindOfClass:[OEControlsKeyHeadlineCell class]])
if([item isKindOfClass:[NSTextField class]] && [[(NSControl*)item cell] isKindOfClass:[OEControlsKeyHeadlineCell class]])
{
j--;
continue;
Expand All @@ -208,6 +209,13 @@ - (void)setupSubviews

- (void)layoutSubviews:(BOOL)animated
{
// Disable animations if running on lion
int majorVersion, minorVersion;
if(GetSystemVersion(&majorVersion, &minorVersion, NULL) && majorVersion == 10 && minorVersion == 7)
{
animated = NO;
}

#define animated(_X_) animated?[_X_ animator]:_X_
#define reflectSectionState(_ITEM_, _RECT_) if(sectionCollapsed){[_ITEM_ setAlphaValue:0.0];_RECT_.origin.y = headerOrigin.y; _RECT_.size.height=sectionTitleHeight; }else{[_ITEM_ setAlphaValue:1.0];}
if(animated) [CATransaction begin];
Expand Down

0 comments on commit 4e59b67

Please sign in to comment.