WindowController: Make sure the subview is the right size before adding it

This fixes a rendering bug when you start in commit view and 
then switch to History view.
This commit is contained in:
Pieter de Bie
2008-09-28 16:14:47 +02:00
parent 1028157cbc
commit 01966d59c7
+2 -3
View File
@@ -62,7 +62,8 @@
viewController = [[PBGitCommitController alloc] initWithRepository:repository superController:self];
}
// make sure we automatically resize the controller's view to the current window size
[[viewController view] setFrame: [contentView bounds]];
//// embed the current view to our host view
[contentView addSubview: [viewController view]];
@@ -72,8 +73,6 @@
if ([viewController respondsToSelector:@selector(commitController)])
[self bind:@"searchController" toObject:viewController withKeyPath:@"commitController" options:nil];
// make sure we automatically resize the controller's view to the current window size
[[viewController view] setFrame: [contentView bounds]];
[self didChangeValueForKey:@"viewController"]; // this will trigger the NSTextField's value binding to change
}