Min size now changes for minimal view.

This commit is contained in:
Mitchell Livingston 2006-07-16 05:40:47 +00:00
parent b671e909db
commit 1f920e8ff7
1 changed files with 26 additions and 6 deletions

View File

@ -111,12 +111,6 @@ static void sleepCallBack(void * controller, io_service_t y,
[fWindow setToolbar: fToolbar]; [fWindow setToolbar: fToolbar];
[fWindow setDelegate: self]; [fWindow setDelegate: self];
//window min height
NSSize contentMinSize = [fWindow contentMinSize];
contentMinSize.height = [[fWindow contentView] frame].size.height - [fScrollView frame].size.height
+ [fTableView rowHeight] + [fTableView intercellSpacing].height;
[fWindow setContentMinSize: contentMinSize];
//set table size //set table size
if ([fDefaults boolForKey: @"SmallView"]) if ([fDefaults boolForKey: @"SmallView"])
{ {
@ -124,6 +118,12 @@ static void sleepCallBack(void * controller, io_service_t y,
[fSmallViewItem setState: NSOnState]; [fSmallViewItem setState: NSOnState];
} }
//window min height
NSSize contentMinSize = [fWindow contentMinSize];
contentMinSize.height = [[fWindow contentView] frame].size.height - [fScrollView frame].size.height
+ [fTableView rowHeight] + [fTableView intercellSpacing].height;
[fWindow setContentMinSize: contentMinSize];
//set info keyboard shortcuts //set info keyboard shortcuts
unichar ch = NSRightArrowFunctionKey; unichar ch = NSRightArrowFunctionKey;
[fNextInfoTabItem setKeyEquivalent: [NSString stringWithCharacters: & ch length: 1]]; [fNextInfoTabItem setKeyEquivalent: [NSString stringWithCharacters: & ch length: 1]];
@ -1478,6 +1478,26 @@ static void sleepCallBack(void * controller, io_service_t y,
[fSmallViewItem setState: makeSmall]; [fSmallViewItem setState: makeSmall];
[fDefaults setBool: makeSmall forKey: @"SmallView"]; [fDefaults setBool: makeSmall forKey: @"SmallView"];
//window min height
NSSize contentMinSize = [fWindow contentMinSize],
contentSize = [[fWindow contentView] frame].size;
contentMinSize.height = contentSize.height - [fScrollView frame].size.height
+ [fTableView rowHeight] + [fTableView intercellSpacing].height;
[fWindow setContentMinSize: contentMinSize];
//resize for larger min height
if (!makeSmall && contentSize.height < contentMinSize.height)
{
NSRect frame = [fWindow frame];
float heightChange = contentMinSize.height - contentSize.height;
frame.size.height += heightChange;
frame.origin.y -= heightChange;
[fWindow setFrame: frame display: YES animate: NO];
[fTableView reloadData];
}
} }
- (void) toggleStatusBar: (id) sender - (void) toggleStatusBar: (id) sender