1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:57:35 +00:00

MacPF: Add a small group header in front of the outline

This has to be part of the data source, which makes things a bit
annoying.

For PDFs that have no outline, it says "(No outline)".
This commit is contained in:
Nico Weber 2023-10-08 23:07:52 -04:00 committed by Tim Flynn
parent fee50cb387
commit a75f876ec0
3 changed files with 41 additions and 2 deletions

View file

@ -69,6 +69,7 @@
{
_outlineView = [[NSOutlineView alloc] initWithFrame:NSZeroRect];
_outlineView.floatsGroupRows = NO;
_outlineView.focusRingType = NSFocusRingTypeNone;
_outlineView.headerView = nil;
@ -179,6 +180,16 @@
#pragma mark - NSOutlineViewDelegate
- (BOOL)outlineView:(NSOutlineView*)outlineView isGroupItem:(id)item
{
return [item isGroupItem];
}
- (BOOL)outlineView:(NSOutlineView*)outlineView shouldSelectItem:(id)item
{
return ![self outlineView:outlineView isGroupItem:item];
}
// "This method is required if you wish to turn on the use of NSViews instead of NSCells."
- (NSView*)outlineView:(NSOutlineView*)outlineView viewForTableColumn:(NSTableColumn*)tableColumn item:(id)item
{