mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:07:45 +00:00
MacPDF: Replace newlines with spaces in outline titles
Else, outline items that have newlines in them end up with a weird vertical offset. (This does affect the outline item's tooltip, which shows the whole title. But not having a newline there seems alright, arguably preferable.)
This commit is contained in:
parent
e13954410a
commit
ec190baa55
1 changed files with 6 additions and 1 deletions
|
@ -60,7 +60,12 @@
|
||||||
{
|
{
|
||||||
if (_groupName)
|
if (_groupName)
|
||||||
return _groupName;
|
return _groupName;
|
||||||
return [NSString stringWithUTF8String:_item->title.characters()];
|
NSString* title = [NSString stringWithUTF8String:_item->title.characters()];
|
||||||
|
|
||||||
|
// Newlines confuse NSOutlineView, at least in sidebar style (even with `usesSingleLineMode` set to YES on the cell view's text field).
|
||||||
|
title = [[title componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]] componentsJoinedByString:@" "];
|
||||||
|
|
||||||
|
return title;
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue