mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
d669050551
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 <heipei@hackvalue.de>
29 lines
603 B
Objective-C
29 lines
603 B
Objective-C
//
|
|
// 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
|