* Source/NSBrowser.m: Small refactoring to simplify code.

Remove update logic from -setSeparatesColumns: and just use
-tile. Tested by toggling "separates columns" flag in Gorm.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37173 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Eric Wasylishen 2013-09-29 22:44:57 +00:00
parent 8b6fffb7fc
commit f0b96e967f
2 changed files with 14 additions and 18 deletions

View file

@ -1,3 +1,9 @@
2013-09-29 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSBrowser.m: Small refactoring to simplify code.
Remove update logic from -setSeparatesColumns: and just use
-tile. Tested by toggling "separates columns" flag in Gorm.
2013-09-29 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSBrowser.m: Change NSBR_COLUMN_SEP and NSBR_VOFFSET

View file

@ -1270,24 +1270,9 @@ static CGFloat browserVerticalPadding;
*/
- (void) setSeparatesColumns: (BOOL)flag
{
NSBrowserColumn *bc;
NSScrollView *sc;
NSBorderType bt;
NSInteger i, columnCount;
// if this flag already set or browser is titled -- do nothing
if (_separatesColumns == flag || _isTitled)
if (_isTitled)
return;
columnCount = [_browserColumns count];
bt = flag ? NSBezelBorder : NSNoBorder;
for (i = 0; i < columnCount; i++)
{
bc = [_browserColumns objectAtIndex: i];
sc = [bc columnScrollView];
[sc setBorderType:bt];
}
_separatesColumns = flag;
[self tile];
[self setNeedsDisplay:YES];
@ -1786,9 +1771,9 @@ static CGFloat browserVerticalPadding;
else
{
if (column == _firstVisibleColumn)
rect.origin.x = (n * _columnSize.width) + 2;
rect.origin.x += 2;
else
rect.origin.x = (n * _columnSize.width) + (n + 2);
rect.origin.x += (n + 2);
}
// Adjust for horizontal scroller
@ -1970,6 +1955,11 @@ static CGFloat browserVerticalPadding;
return;
}
{
NSBorderType bt = _separatesColumns ? NSBezelBorder : NSNoBorder;
[sc setBorderType: bt];
}
[sc setFrame: [self frameOfColumn: i]];
matrix = [bc columnMatrix];