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

add UTType conformance checks in NonTextFileView to properly preview files using QuickLook #1783

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

plbstl
Copy link
Contributor

@plbstl plbstl commented Jul 1, 2024

Description

This PR helps to properly preview files using QuickLook.

See #1768.

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Cc: @bombardier200

This helps to properly preview files using QuickLook
@thecoolwinter
Copy link
Collaborator

Does this fix a bug or is it just for semantics? It looks like the functionality is the same w/ the switch statement

@matthijseikelenboom
Copy link
Contributor

The switch statement looks cleaner imo...

@armartinez
Copy link
Contributor

@thecoolwinter @matthijseikelenboom I thought the same thing but I think the difference is the call to the conforms method, since many UTTypes can conform to a base UTType, am I right @plbstl ?

@plbstl
Copy link
Contributor Author

plbstl commented Jul 4, 2024

Yes @armartinez. Without the conformance checks, smaller images will not be shown in their proper dimensions, instead, they'll be scaled up to fit the editor view.

You can test it out in the main branch with any of the CodeEdit icons. Or something similar.

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.

None yet

4 participants