Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update File Outline outline view to use view-based table cells #17

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

undecoded-coder
Copy link
Contributor

Updates the File Outline NSOutlineView to be view-based (#15), including using NSImageView for native icon image rendering and removing its dependency on the IconTextCell class.

Note: Due to changes in NSOutlineView/NSTableView when using view-based table cells, namely that selection is not persisted across calls to -reloadData since the row views will be entirely discarded during a reload, it was necessary to make changes to how selection is managed in -[LDrawDocument docChanged:] in order to properly manage selection.

Other changes:

  • Silenced the console flooding with 'Unparsable META command' output when reading related.ldr
  • Various minor code changes

Outstanding issues:
- Selection is lost during reloads (and causes issues deselecting!)
• Also set outlive view cell text from delegate method instead of using Cocoa Bindings (for consistency with icon image using the same method)
• Remove code from previous attempts to fix outline view selection
• Minor stylistic changes
• Also updates outline view cells to use auto layout constraints to ensure proper sizing when using Source List styling
// actually catch something unexpected here, but as the majority of
// meta commands we could possibly care about include the prefix, it
// seems like a good balance.
if ([parsedField containsString:@"!"])
printf("Unparsable META command: %s\n", [orig_line UTF8String]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I’m not sure what the actual intention of this logging is, it may be that something just needs updated so that normal meta commands aren’t reaching this; or maybe this logging should be removed altogether?

I was just having trouble doing some debugging with the console filled with every comment or meta command in the related parts file so I did this so I wouldn’t have to deal with it. If there is something else you would rather do let me know.

@undecoded-coder
Copy link
Contributor Author

undecoded-coder commented Feb 15, 2022

@allenmonroesmith I think this is at a point it can be merged if everything looks good to you!
Though let me know if I should do anything different with the change in RelatedParts.m regarding my comment above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant