mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 21:54:40 +03: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
Notes:
sideshowbarker
2024-07-18 00:34:07 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/ec190baa55 Pull-request: https://github.com/SerenityOS/serenity/pull/22009
@ -60,7 +60,12 @@
|
||||
{
|
||||
if (_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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user