-
-
Notifications
You must be signed in to change notification settings - Fork 285
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 QuickLook support #2082
base: dev
Are you sure you want to change the base?
Add QuickLook support #2082
Conversation
- Adapted from Files
- Internal and external preview can't open at the same time - Always preview option doesn't control external
This comment has been minimized.
This comment has been minimized.
Just got a chance to test run this. It looks very good! I have a few opinions on some of your problems listed:
I don't think this works well with quick look as both windows overlap.
I think we can resolve this by greying out this option if a QuickLook installation is not detected. This can be tricky though as QuickLook is available in many different forms including the Windows app store. Instead of tracking all this down we could send a pipe message and check its status to see if quick look is available and determine to enable the option.
This was also an issue with the original PR. |
QuickLook functionality should be provided fully by a plugin. To achieve this we need to use this #1013, and this pr is a working POC already. |
I don't think @VictoriousRaptor was around for that. But yes as a plugin would be ideal. Also I would use this PR in favor of my older code. This is more fleshed out. |
Maybe best that @VictoriousRaptor just continue work as is with this one so we can keep the momentum, once I helped onesound I will come back to finishing off that pr 1013 and migrate the finished code here into a plugin. |
Ok I'll do some more tests on this PR and try to figure out the problems. |
Greying out option is good. And what if user enables this option (with QuickLook installed and running), and then quit QuickLook and preview in Flow? Should we fallback to Flow's preview? And what kind of message to tell users we are not able to launch QuickLook? Maybe a notification toast?
Not a big deal. Just manually set it once and for all. |
Can't this be detected from user settings, preview -> built-in or QuickLook |
This is the current implementation but logic to deciding to use which preview is not clear. I spent quite a lot of time on it. I don't have time to review this PR this week so if we want to merge now it requires more detailed review from the team. |
Updated this PR with (see commits):
|
@@ -622,7 +622,7 @@ private async void OnDeactivated(object sender, EventArgs e) | |||
if (_settings.UseAnimation) | |||
await Task.Delay(100); | |||
|
|||
if (_settings.HideWhenDeactivated) | |||
if (_settings.HideWhenDeactivated && !_viewModel.ExternalPreviewVisible) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for when you click away from the mouse it doesnt hide both the search window and preview. Not sure which is user-friendlier, hide when deactivated or do not.
break; | ||
|
||
case true | ||
when !ExternalPreviewVisible && Settings.AlwaysPreview && CanExternalPreviewSelectedResult(out var path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I enable AlwaysPreview QuickLook automatically pops whenever I type. Not usable imo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah i know, there is the option to switch AlwaysPreview off. The real problem is QuickLook doesnt remember last position, but nothing we can do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So AlwaysPreview shouldn't control external preview.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to align the behaviour for both internal and external so logic is a bit more straightforward, and also not just build logic for QuickLook because in the future we may integrate with another preview tool that works well with always preview option. For now user can just switch it off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to set a "always external preview" in preview plugin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, let's not not add additional logic when there is already a button that does exactly that.
@@ -871,7 +871,7 @@ public void ResetPreview() | |||
{ | |||
if (Settings.AlwaysPreview) | |||
{ | |||
ShowPreview(); | |||
ShowInternalPreview(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When AlwaysPreview
is true, specify internal preview.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because QL is not suitable for using with always preview right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because QL is not suitable for using with always preview right?
Yep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when we have other preview tools that is suitable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when we have other preview tools that is suitable?
Well maybe pass always preview to plugin and let plugin decide? If plugin returns false then use internal preview.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Let me know if good to merge.
@@ -0,0 +1,51 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we merge is this plugin going to be a default one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I will take it out before merge. There is already a QL plugin repo in the org.
Refined version of #859. Too many merging conflict so I just create a new branch instead. Compatible with our preview function.
Changes
FilePath
forResult.Preview
to indicate what file should QuickLook preview.Behavior
Preview.FilePath
try to use QuickLook to preview.Preview.FilePath
pressing hotkey only triggers QuickLook.Problems
Should "Always Preview" open QuickLook?NoWhen "Always Preview" is on (which means internal preview is on), selecting another result that can use QuickLook triggers QuickLook. Looks bad.When "Use QuickLook" is on but QuickLook is not launched or installed what kind of warning should be send to users?Send a notificationNo QuickLook API to set on top. (Open selected result in quicklook #859 (comment))Manually set it.Switching from external preview result to builtin result doesn't properly trigger builtin preview.TODO
Screenshot