add UTType conformance checks in NonTextFileView to properly preview files using QuickLook#1783
Merged
thecoolwinter merged 1 commit intoCodeEditApp:mainfrom Jul 7, 2024
Conversation
This helps to properly preview files using QuickLook
Collaborator
|
Does this fix a bug or is it just for semantics? It looks like the functionality is the same w/ the switch statement |
Contributor
|
The switch statement looks cleaner imo... |
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 ? |
Contributor
Author
|
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. |
thecoolwinter
approved these changes
Jul 4, 2024
Collaborator
thecoolwinter
left a comment
There was a problem hiding this comment.
Good catch, I see the difference now.
tom-ludwig
approved these changes
Jul 4, 2024
plbstl
added a commit
to plbstl/CodeEdit
that referenced
this pull request
Jul 23, 2024
…utType but are neither images nor PDFs See CodeEditApp#1783
austincondiff
added a commit
that referenced
this pull request
Jul 27, 2024
…ed (#1822) * important fix to preview fileDocuments (using QuickLook) that have a utType but are neither images nor PDFs See #1783 * make `NonTextFileView` a bit more readable * nest duplicate `utType` if checks in `NonTextFileView` * Update CodeEdit/Features/Editor/Views/NonTextFileView.swift --------- Co-authored-by: Austin Condiff <austin.condiff@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR helps to properly preview files using QuickLook.
See #1768.
Checklist
Cc: @bombardier200