Fix incorrect column size on combo box items

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@40381 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2017-03-10 21:58:38 +00:00
parent 83cb3aa173
commit 773abfa12d

View file

@ -168,6 +168,7 @@ static GSComboWindow *gsWindow = nil;
column = [[NSTableColumn alloc] initWithIdentifier: @"content"];
cell = [[NSCell alloc] initTextCell: @""];
[cell setLineBreakMode: NSLineBreakByTruncatingTail];
[column setDataCell: cell];
RELEASE(cell);
[_tableView addTableColumn: column];
@ -184,7 +185,7 @@ static GSComboWindow *gsWindow = nil;
borderRect.size.height)];
[scrollView setHasVerticalScroller: YES];
[scrollView setDocumentView: _tableView];
[_tableView release];
RELEASE(_tableView);
[box setContentView: scrollView];
RELEASE(scrollView);
@ -204,6 +205,16 @@ static GSComboWindow *gsWindow = nil;
[super dealloc];
}
- (void)setFrame:(NSRect)frameRect display:(BOOL)flag
{
[super setFrame: frameRect display: flag];
// Column needs to track with frame size changes - and since this class breaks
// the GNUstep table view paradigm relationship (NSClipView/NSTableView) and is
// now resized outside the normal sequence we fudge it here...
[[[_tableView tableColumns] objectAtIndex: 0] setWidth: frameRect.size.width];
}
- (void) layoutWithComboBoxCell: (NSComboBoxCell *)comboBoxCell
{
NSSize bsize = [[GSTheme theme] sizeForBorderType: NSLineBorder];