From 01966d59c72709508f4e719e81c7a83f1d85f89d Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Sun, 28 Sep 2008 16:14:47 +0200 Subject: [PATCH] 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. --- PBGitWindowController.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PBGitWindowController.m b/PBGitWindowController.m index 909f4a9..ddde56c 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -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 }