From: Justin Anderson Date: Wed, 8 Oct 2008 02:01:06 +0000 (+0000) Subject: KerberosAgent should handle zoom button better X-Git-Tag: krb5-1.7-alpha1~333 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=496824e88da18a3a237837dc270df375518a546a;p=krb5.git KerberosAgent should handle zoom button better The Select Identity dialog should resize to fit the available identities in its table when the zoom button is clicked. ticket: new status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20840 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kim/agent/mac/SelectIdentityController.h b/src/kim/agent/mac/SelectIdentityController.h index 29b3c0dd4..ece2de9e9 100644 --- a/src/kim/agent/mac/SelectIdentityController.h +++ b/src/kim/agent/mac/SelectIdentityController.h @@ -42,6 +42,7 @@ IBOutlet NSTextField *headerTextField; IBOutlet NSTextField *explanationTextField; + IBOutlet NSScrollView *identityTableScrollView; IBOutlet NSTableView *identityTableView; IBOutlet NSButton *addIdentityButton; IBOutlet NSPopUpButton *actionPopupButton; diff --git a/src/kim/agent/mac/SelectIdentityController.m b/src/kim/agent/mac/SelectIdentityController.m index 4ad47c93e..44fc30bc8 100644 --- a/src/kim/agent/mac/SelectIdentityController.m +++ b/src/kim/agent/mac/SelectIdentityController.m @@ -99,6 +99,22 @@ // --------------------------------------------------------------------------- +- (NSRect) windowWillUseStandardFrame: (NSWindow *) window defaultFrame: (NSRect) defaultFrame +{ + NSRect newFrame = [window frame]; + CGFloat oldHeight = [[identityTableScrollView contentView] frame].size.height; + CGFloat newHeight = [identityTableView numberOfRows] * + ([identityTableView rowHeight] + [identityTableView intercellSpacing].height); + CGFloat yDelta = newHeight - oldHeight; + + newFrame.origin.y -= yDelta; + newFrame.size.height += yDelta; + + return newFrame; +} + +// --------------------------------------------------------------------------- + - (void) setContent: (NSMutableDictionary *) newContent { [self window]; // wake up the nib connections diff --git a/src/kim/agent/mac/resources/English.lproj/SelectIdentity.xib b/src/kim/agent/mac/resources/English.lproj/SelectIdentity.xib index 0bc766914..c588d9157 100644 --- a/src/kim/agent/mac/resources/English.lproj/SelectIdentity.xib +++ b/src/kim/agent/mac/resources/English.lproj/SelectIdentity.xib @@ -472,7 +472,6 @@ - 3 YES 2 YES @@ -522,7 +521,7 @@ {3.40282e+38, 3.40282e+38} - + 258 YES @@ -531,7 +530,6 @@ 266 {{78, 306}, {329, 22}} - YES -1804468671 @@ -560,7 +558,6 @@ 268 {{17, 308}, {60, 17}} - YES 68288064 @@ -587,7 +584,6 @@ 266 {{24, 179}, {337, 25}} - YES 67501824 @@ -612,7 +608,6 @@ 268 {{13, 211}, {185, 17}} - YES 67239424 @@ -629,7 +624,6 @@ 266 {{23, 157}, {339, 14}} - YES 67239424 @@ -646,7 +640,6 @@ 268 {{13, 132}, {133, 17}} - YES 67239424 @@ -663,7 +656,6 @@ 266 {{42, 34}, {301, 25}} - YES 67501824 @@ -692,7 +684,6 @@ 268 {{24, 86}, {303, 18}} - YES 67239424 @@ -716,7 +707,6 @@ 268 {{24, 108}, {351, 18}} - YES 67239424 @@ -738,7 +728,6 @@ 268 {{24, 64}, {248, 18}} - YES 67239424 @@ -760,7 +749,6 @@ 266 {{41, 12}, {303, 14}} - YES 67239424 @@ -775,12 +763,10 @@ {{3, 3}, {387, 238}} - {{17, 56}, {393, 244}} - {0, 0} 67239424 @@ -804,7 +790,6 @@ 289 {{331, 12}, {82, 32}} - YES 67239424 @@ -825,7 +810,6 @@ 289 {{249, 12}, {82, 32}} - YES 67239424 @@ -846,7 +830,6 @@ 289 {{129, 12}, {120, 32}} - YES 67239424 @@ -867,7 +850,6 @@ -2147483380 {{75, 308}, {335, 17}} - YES 68288064 @@ -881,8 +863,6 @@ {427, 348} - - {{0, 0}, {1280, 778}} {3.40282e+38, 3.40282e+38} @@ -1671,7 +1651,7 @@ arrangedObjects.identity NSConditionallySetsEditable - + 2 @@ -1707,7 +1687,7 @@ selection.identity_string NSContinuouslyUpdatesValue - + 2 @@ -1730,6 +1710,14 @@ 300510 + + + identityTableScrollView + + + + 300511 + @@ -2479,7 +2467,7 @@ {{503, 256}, {419, 465}} - + {800, 800} {400, 273} com.apple.InterfaceBuilder.CocoaPlugin @@ -2508,7 +2496,7 @@ - 300510 + 300511 @@ -2591,6 +2579,7 @@ identityField identityOptionsController identityOptionsWindow + identityTableScrollView identityTableView kerberosIconImageView longTimeFormatter @@ -2614,6 +2603,7 @@ NSTextField NSObjectController NSWindow + NSScrollView NSTableView BadgedImageView KerberosTimeFormatter