mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 08:30:59 +00:00
* 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:
parent
2decccabe0
commit
f1b45bbcad
2 changed files with 68 additions and 5 deletions
13
ChangeLog
13
ChangeLog
|
@ -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>
|
||||
|
||||
* Source/NSMenuView.m (- _trackWithEvent:startingMenuView:): If menu
|
||||
|
@ -26,7 +33,7 @@
|
|||
* Source/NSImage.m: Missing -retain inside the method
|
||||
-compositeToPoint:fromRect:operation:fraction: caused a crash
|
||||
inside Opal backend.
|
||||
|
||||
|
||||
* Source/NSImage.m: Missing -retain inside the method
|
||||
-drawInRect:fromRect:... caused a crash inside Opal backend.
|
||||
|
||||
|
@ -59,8 +66,8 @@
|
|||
|
||||
2013-09-17 Ivan Vucica <ivan@vucica.net>
|
||||
|
||||
* Source/NSLayoutManager.m:
|
||||
advancementbuf[0] was not being filled. Most backends, including cairo,
|
||||
* Source/NSLayoutManager.m:
|
||||
advancementbuf[0] was not being filled. Most backends, including cairo,
|
||||
ignore advancements, so the bug was not immediately apparent until
|
||||
opal backend started using the advancements.
|
||||
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
@ -358,8 +407,15 @@ static NSFont *_leafFont;
|
|||
}
|
||||
|
||||
// Draw the body of the cell
|
||||
[self _drawAttributedText: [self attributedStringValue]
|
||||
inFrame: title_rect];
|
||||
if (_cell.in_editing)
|
||||
{
|
||||
[self _drawEditorWithFrame: cellFrame inView: controlView];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self _drawAttributedText: [self attributedStringValue]
|
||||
inFrame: title_rect];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue