Skip to content
Browse files

Fixed an issue with save panels and such

  • Loading branch information...
1 parent 7ef2488 commit 6f82fdf1ae49f51bf71e81b861e2b4a23026851e @alexzielenski committed
View
29,666 ....xcodeproj/project.xcworkspace/xcuserdata/Alex.xcuserdatad/UserInterfaceState.xcuserstate
14,897 additions, 14,769 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
2 Black Mac OS X/Classes/SIMBL/BMXController.m
@@ -41,6 +41,6 @@ - (void)swizzle {
[NSThemeFrame swizzle];
[NSCell swizzle];
[NSButtonCell swizzle];
-// [NSSegmentedCell swizzle];
+ [NSSegmentedCell swizzle];
}
@end
View
24 Black Mac OS X/Classes/SIMBL/Categories/BMXCell.m
@@ -97,7 +97,17 @@ + (NSGradient*)selectedGradient {
}
@end
@implementation NSSegmentedCell (BMXSegmentedCell)
-
++ (void)swizzle {
+ NSError *err = nil;
+ [self jr_aliasMethod:@selector(_coreUIDrawSegmentBackground:withCellFrame:inView:)
+ withSelector:@selector(orig_coreUIDrawSegmentBackground:withCellFrame:inView:)
+ error:&err];
+ NSLog(@"%@", err);
+ [self jr_swizzleMethod:@selector(_coreUIDrawSegmentBackground:withCellFrame:inView:)
+ withMethod:@selector(new_coreUIDrawSegmentBackground:withCellFrame:inView:)
+ error:&err];
+ NSLog(@"%@", err);
+}
- (NSBackgroundStyle)interiorBackgroundStyle {
return NSBackgroundStyleLowered;
}
@@ -110,9 +120,13 @@ - (long long)interiorBackgroundStyleForSegment:(long long)arg1 {
- (long long)_initialBackgroundStyleCompatibilityGuess {
return NSBackgroundStyleLowered;
}
-- (BOOL)_coreUIDrawSegmentBackground:(long long)arg1 withCellFrame:(struct CGRect)arg2 inView:(id)arg3 {
- NSRect frame = NSRectFromCGRect(arg2);
- NSInteger segmentCount = [(NSSegmentedControl*)arg3 segmentCount];
+- (BOOL)new_coreUIDrawSegmentBackground:(long long)arg1 withCellFrame:(NSRect)arg2 inView:(NSView*)arg3 {
+ NSRect frame = arg2;
+ NSInteger segmentCount;
+ if (![arg3 respondsToSelector:@selector(segmentCount)]) {
+ return [self orig_coreUIDrawSegmentBackground:arg1 withCellFrame:arg2 inView:arg3];
+ } else
+ segmentCount = [(NSSegmentedControl*)arg3 segmentCount];
NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:frame
cornerRadius:4.0];
@@ -145,7 +159,7 @@ - (BOOL)_coreUIDrawSegmentBackground:(long long)arg1 withCellFrame:(struct CGRec
[path2 release];
NSInteger currentSeg = 0;
while (currentSeg<segmentCount) {
- NSRect sepRect = NSRectFromCGRect([self _rectForSegment:currentSeg inFrame:arg2]);
+ NSRect sepRect = NSRectFromCGRect([self _rectForSegment:currentSeg inFrame:NSRectToCGRect(arg2)]);
if (currentSeg-segmentCount+1<0) {
[[NSColor blackColor] set];
NSRectFill(NSMakeRect(NSMaxX(sepRect)-1, 0, 1, NSHeight(sepRect)));
View
22 Black Mac OS X/Classes/SIMBL/Views/BMXThemeFrame.m
@@ -76,16 +76,16 @@ - (BOOL)isBMXCustomized {
#pragma mark - Drawing
- (void)new_drawTitleBar:(struct CGRect)arg1 { // IMP=0x001023e0
- if (!self._isHUDWindow)
- [self drawTitleBar];
- else {
+ if ((self.styleMask & NSTitledWindowMask)!=NSTitledWindowMask) {
[self orig_drawTitleBar:arg1];
+ return;
}
+ [self drawTitleBar];
}
- (void)new_drawFrame:(struct CGRect)arg1 {
- if (self._isHUDWindow) {
+ if ((self.styleMask & NSTitledWindowMask)!=NSTitledWindowMask) {
[self orig_drawFrame:arg1];
- return; // we dont want to break HUD
+ return;
}
// If it isn't textured , draw the titlebar;
@@ -140,6 +140,11 @@ - (void)drawHighlightsWithCorners:(BOOL)useCorners {
- (void)new_drawRect:(NSRect)fp8 {
// // I don't know what the original drawRect: does, nor do i want to mess with it so lets just draw the bottom bar over it.
// [self orig_drawRect:fp8];
+ if ((self.styleMask & NSTitledWindowMask)!=NSTitledWindowMask) {
+ [self orig_drawRect:fp8];
+ return;
+ }
+
NSEraseRect(self.bounds);
[[NSColor clearColor] set];
NSRectFillUsingOperation(self.bounds, NSCompositeClear);
@@ -158,6 +163,8 @@ - (void)new_drawRect:(NSRect)fp8 {
#pragma mark - Title
- (id)new_customTitleCell {
id cell = [self orig_customTitleCell];
+ if ((self.styleMask & NSTitledWindowMask)!=NSTitledWindowMask)
+ return cell;
if (cell)
[(NSTextFieldCell*)cell setBackgroundStyle:NSBackgroundStyleLowered];
return cell;
@@ -178,6 +185,9 @@ - (void)drawBottomBar {
onTop:NO];
}
- (void)drawTitleBar {
+ if ((self.styleMask & NSTitledWindowMask)!=NSTitledWindowMask)
+ return;
+
BOOL utilityWindow = ((self.styleMask&NSUtilityWindowMask)==NSUtilityWindowMask);
CGFloat topBarHeight = self._topBarHeight;
@@ -201,6 +211,8 @@ - (void)drawTitleBar {
}
- (void)drawTitleGradientInRect:(NSRect)titleRect cornerRadius:(CGFloat)cornerRadius roundCorners:(OSCornerType)corner onTop:(BOOL)top {
// Black outline around the top for perfection, -0.5 corner radius
+ if ((self.styleMask & NSTitledWindowMask)!=NSTitledWindowMask)
+ return;
[NSGraphicsContext saveGraphicsState];
NSRect rect = titleRect;
NSBezierPath *path = nil;

0 comments on commit 6f82fdf

Please sign in to comment.
Something went wrong with that request. Please try again.