only set the splitter position the first time through, not ever time the

view is displayed
This commit is contained in:
pinkerton%aol.net 2004-02-12 07:29:43 +00:00
parent a41a489fe4
commit f4bb39a840
2 changed files with 10 additions and 5 deletions

View File

@ -70,6 +70,7 @@
IBOutlet HistoryDataSource* mHistorySource; //can swap to this for history data
BOOL mSetupComplete; // have we been fully initialized?
BOOL mSplittersRestored; // splitters can only be positioned after we resize to fit the window
NSMutableDictionary *mExpandedStatus;
NSString* mCachedHref;
BookmarkFolder *mActiveRootCollection;

View File

@ -88,6 +88,7 @@ const long kMinSearchPaneHeight = 80;
mExpandedStatus = nil;
mSearchResultArray = nil;
mOpenActionFlag = 0;
mSplittersRestored = NO;
// wait for |-completeSetup| to be called to lazily complete our setup
mSetupComplete = NO;
@ -643,11 +644,14 @@ const long kMinSearchPaneHeight = 80;
// manager view resized correctly. If we did it earlier, it would resize again
// to stretch proportionally to the size of the browser window, destroying
// the width we just set.
const float kDefaultSplitWidth = kMinContainerSplitWidth;
float savedWidth = [[NSUserDefaults standardUserDefaults] floatForKey:USER_DEFAULTS_CONTAINER_SPLITTER_WIDTH];
if (savedWidth < kDefaultSplitWidth)
savedWidth = kDefaultSplitWidth;
[mContainersSplit setLeftWidth:savedWidth];
if (!mSplittersRestored) {
const float kDefaultSplitWidth = kMinContainerSplitWidth;
float savedWidth = [[NSUserDefaults standardUserDefaults] floatForKey:USER_DEFAULTS_CONTAINER_SPLITTER_WIDTH];
if (savedWidth < kDefaultSplitWidth)
savedWidth = kDefaultSplitWidth;
[mContainersSplit setLeftWidth:savedWidth];
mSplittersRestored = YES; // needed first time only
}
}
- (void) setCanEditSelectedContainerContents:(BOOL)inCanEdit