QLMarkdown icon indicating copy to clipboard operation
QLMarkdown copied to clipboard

Feature request: Remember QL window size and position between uses

Open martinpk opened this issue 1 year ago • 5 comments

It would be helpful if QLMarkdown would remember the QuickLook window size and position between uses, especially on wider displays. On my ultrawide display, the window is three times as wide as the markdown render area, and seemingly randomly positioned.

Thanks for a great QL plugin, @sbarex!

martinpk avatar Jul 10 '24 11:07 martinpk

I am sorry, but Apple does not provide APIs to set or register the position and size of the QL window. It should be the operating system that remembers these settings

sbarex avatar Aug 05 '24 18:08 sbarex

On further experimentation, the OS seems to be trying to restore the window to the same position, but given that the QL Markdown window is so wide, it's choosing the nearest on-screen coordinates to contain the whole window, which can be quite different from the previous position. Do you have any control over the width of the window? It's actually about 5x (not 3x as I said above) the width of the content render area. I haven't seen this with other plugins

For example: image

It seems to do this with a variety of MD files.

The QL plugin for .csv files, for example, seems to set the window width to match the content; but maybe that's an Apple plugin that uses an undocumented API or something.

image

martinpk avatar Aug 06 '24 13:08 martinpk

On the app, you can set a fixed window size:

Screenshot 2024-08-06 alle 15 49 26

sbarex avatar Aug 06 '24 13:08 sbarex

Thank you!

I hadn't noticed that since, by default, it says "Quick Look window: Auto", and I had not explored the options. Would it help discoverability to label it "QL window size:" and/or show the size fields grayed out when on Auto? Also add "(w)" and "(h)" after the fields?

Could your calculation of the Auto size have a maximum, so that it doesn't produce ultra-wide windows on ultra-wide monitors by default?

Again, thanks for a great plugin!

martinpk avatar Aug 06 '24 15:08 martinpk

"auto" means that the size is left to the operating system.

sbarex avatar Aug 06 '24 17:08 sbarex