-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PBCollapsibleSplitView as subclass of PBNiceSplitView
This adds a subclass to PBNiceSplitView which has collapsible subviews as well as an uncollapse-method. The initWithTopMin method is used to set the minimum sizes for the subviews. Signed-off-by: Johannes Gilger <[email protected]>
- Loading branch information
Showing
6 changed files
with
113 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// PBCollapsibleSplitView.h | ||
// GitX | ||
// | ||
// Created by Johannes Gilger on 6/21/09. | ||
// Copyright 2009 Johannes Gilger. All rights reserved. | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
#import "PBNiceSplitView.h" | ||
|
||
@interface PBCollapsibleSplitView : PBNiceSplitView { | ||
CGFloat topViewMin; | ||
CGFloat bottomViewMin; | ||
} | ||
|
||
@property (readonly) CGFloat topViewMin; | ||
@property (readonly) CGFloat bottomViewMin; | ||
|
||
- (void)setTopMin:(CGFloat)topMin andBottomMin:(CGFloat)bottomMin; | ||
- (void)uncollapse; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// PBCollapsibleSplitView.m | ||
// GitX | ||
// | ||
// Created by Johannes Gilger on 6/21/09. | ||
// Copyright 2009 Johannes Gilger. All rights reserved. | ||
// | ||
|
||
#import "PBCollapsibleSplitView.h" | ||
|
||
@implementation PBCollapsibleSplitView | ||
@synthesize topViewMin, bottomViewMin; | ||
|
||
- (void)setTopMin:(CGFloat)topMin andBottomMin:(CGFloat)bottomMin { | ||
topViewMin = topMin; | ||
bottomViewMin = bottomMin; | ||
} | ||
|
||
- (void)uncollapse { | ||
for (NSView *subview in [self subviews]) { | ||
if([self isSubviewCollapsed:subview]) { | ||
[self setPosition:[self frame].size.height / 3 ofDividerAtIndex:0]; | ||
[self adjustSubviews]; | ||
} | ||
} | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters