* Source/NSBrowserCell.m (-drawInteriorWithFrame:inView:): Don't

draw string when editing.
        * Source/NSBrowserCell.m (-titleRectForBounds:): Implement to
        exactly match calculation in -drawInteriorWithFrame:inView:.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37159 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2013-09-27 13:10:23 +00:00
parent 054851fa01
commit b751aed5b0
2 changed files with 68 additions and 5 deletions

View file

@ -1,3 +1,10 @@
2013-09-27 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSBrowserCell.m (-drawInteriorWithFrame:inView:): Don't
draw string when editing.
* Source/NSBrowserCell.m (-titleRectForBounds:): Implement to
exactly match calculation in -drawInteriorWithFrame:inView:.
2013-09-27 German Arias <germanandre@gmx.es> 2013-09-27 German Arias <germanandre@gmx.es>
* Source/NSMenuView.m (- _trackWithEvent:startingMenuView:): If menu * Source/NSMenuView.m (- _trackWithEvent:startingMenuView:): If menu
@ -26,7 +33,7 @@
* Source/NSImage.m: Missing -retain inside the method * Source/NSImage.m: Missing -retain inside the method
-compositeToPoint:fromRect:operation:fraction: caused a crash -compositeToPoint:fromRect:operation:fraction: caused a crash
inside Opal backend. inside Opal backend.
* Source/NSImage.m: Missing -retain inside the method * Source/NSImage.m: Missing -retain inside the method
-drawInRect:fromRect:... caused a crash inside Opal backend. -drawInRect:fromRect:... caused a crash inside Opal backend.
@ -59,8 +66,8 @@
2013-09-17 Ivan Vucica <ivan@vucica.net> 2013-09-17 Ivan Vucica <ivan@vucica.net>
* Source/NSLayoutManager.m: * Source/NSLayoutManager.m:
advancementbuf[0] was not being filled. Most backends, including cairo, advancementbuf[0] was not being filled. Most backends, including cairo,
ignore advancements, so the bug was not immediately apparent until ignore advancements, so the bug was not immediately apparent until
opal backend started using the advancements. opal backend started using the advancements.

View file

@ -276,6 +276,55 @@ static NSFont *_leafFont;
*/ */
} }
- (NSRect) titleRectForBounds: (NSRect)theRect
{
NSRect titleRect = [super titleRectForBounds: theRect];
NSImage *branch_image = nil;
NSImage *cell_image = [self image];
if (_cell.is_highlighted || _cell.state)
{
if (!_browsercell_is_leaf)
{
branch_image = [object_getClass(self) highlightedBranchImage];
}
if (nil != [self alternateImage])
{
cell_image = [self alternateImage];
}
}
else
{
if (!_browsercell_is_leaf)
{
branch_image = [object_getClass(self) branchImage];
}
}
if (branch_image)
{
NSRect imgRect;
imgRect.size = [branch_image size];
titleRect.size.width -= imgRect.size.width + 8;
}
if (cell_image)
{
NSRect imgRect;
imgRect.size = [cell_image size];
titleRect.origin.x += imgRect.size.width + 4;
titleRect.size.width -= imgRect.size.width + 4;
}
// Skip 2 points from the left border
titleRect.origin.x += 2;
titleRect.size.width -= 2;
return titleRect;
}
/* /*
* Displaying * Displaying
*/ */
@ -358,8 +407,15 @@ static NSFont *_leafFont;
} }
// Draw the body of the cell // Draw the body of the cell
[self _drawAttributedText: [self attributedStringValue] if (_cell.in_editing)
inFrame: title_rect]; {
[self _drawEditorWithFrame: cellFrame inView: controlView];
}
else
{
[self _drawAttributedText: [self attributedStringValue]
inFrame: title_rect];
}
} }
/* /*