Page 1 of 2
SC focus "P" / Preview [Granted]
Posted: 01 Jul 2023 12:01
by FluxTorpedoe
Hi’
Just a (very) minor wish, if easy to implement:
Would it be possible to enhance the SC focus command to focus the floating preview (fullscreen or window)?
It would be even better if it could focus the floating preview (eg focus "FP"), and the internal preview pane (eg focus "PP").
(In case no preview is open, focus wouldn’t change.)
Reason:
When a preview is open by a script, later keyboard shortcuts (eg S or ESC) behave differently if preview has lost focus.
⮚ Select image > ::#1003; ⏎ > S
⇒ toggles Status info on preview (preview has focus)
⮚ Select image > ::#1003; msg 1; ⏎ > ⏎ > S
⇒ does not (preview has lost focus)
That’s problematic for long scripts (eg Slideshow) where –in some cases / user interactions– ESC only closes the preview (script can then take over to end things properly), or ESC ends the script abruptly.
Thanks for your attention,
Flux
Re: SC focus "P" / Preview
Posted: 19 Jul 2023 09:17
by admin
Doable.

Re: SC focus "P" / Preview [Granted]
Posted: 20 Jul 2023 17:11
by FluxTorpedoe
Excellent, working great, thank you!
—————————
It’s already great but I realize there’s a small catch / linked request:
When the floating previews are focused, the first press on ESC closes them (without ending any script) and the focus goes back to whatever was active, whereas ESC on preview pane always ends any running script.
I understand the different nature of the internal preview, but with your update it can now be sort-of-focused (at least as "X" / no XY regular controls focused).
So, could the first press on ESC behave (approximately) the same for all get("FocusedControl") == "X"?
i.e. ESC on X would close focused preview if any/if possible (as it does right now), and switch the focus back to XY last active control —without ending a running script.
Re: SC focus "P" / Preview
Posted: 20 Jul 2023 17:27
by admin
ESC should close (and hide?) the preview pane if the preview pane is focused?
Re: SC focus "P" / Preview
Posted: 20 Jul 2023 17:35
by FluxTorpedoe
Well, I didn’t expect as much…
(I intended to do it through by script)
But since you ask, yes, I think it would make sense that ESC would close/hide it if focused —as with the other previews.
Re: SC focus "P" / Preview
Posted: 20 Jul 2023 19:37
by admin
Well, thinking about it, it looks a bit risky. ESC is a sacred key. It's your last line of defense. I don't want it to be disabled if the focus happens to be on the preview pane.
Re: SC focus "P" / Preview
Posted: 20 Jul 2023 21:52
by FluxTorpedoe
Hum… (Setting aside the question of PP to be closed or not)
I was talking about the first press only on ESC —and only on focused preview.
Anyway, the idea wouldn’t be to disable it (it’s indeed a sacred key!), just to have the first ESC "leave" (//remove focus or close if possible) the current preview if focused.
That’s exactly how it behaves right now, not only with fullscreen (expected behavior for ESC in general), but with floating preview too: even if it’s only a small window while a script is running, ESC won’t stop the script, it will just close the preview and (invisibly) switch the focus, so that a new press on ESC will definitely end any script.
Even trying to think about extremes:
Worst-case scenario, a user is deleting a huge folder—while previewing images! (since we’re only talking about focused previews)—, and he suddenly panics because he realizes that’s the wrong folder! I presume his reflex will definitely be to press ESC several times in a row, just in case…
Or e.g. a user runs a wild script with a loop that won’t stop (still, with PP focused), it’s safe to presume that he will try and press ESC not once but several times to "unfreeze" the UI.
Re: SC focus "P" / Preview
Posted: 21 Jul 2023 11:58
by admin
That's all fine. But I'm still weary. Probably because I don't get the idea. What is this script doing? Why is it moving the focus? Why is it waiting for the user to press ESC?
And a general question to all: Should there be an option to let ESC close any current preview in preview tab and preview pane? (While keeping the file selected?)
Re: SC focus "P" / Preview
Posted: 21 Jul 2023 12:06
by highend
Should there be an option to let ESC close any current preview in preview tab and preview pane? (While keeping the file selected?)
I'd like it
Re: SC focus "P" / Preview
Posted: 21 Jul 2023 12:26
by admin
I played with it and it feels completely natural. I wonder if it should just be like that.
Re: SC focus "P" / Preview
Posted: 21 Jul 2023 12:30
by klownboy
admin wrote: ↑21 Jul 2023 11:58
Should there be an option to let ESC close any current preview in preview tab and preview pane? (While keeping the file selected?)
Seems to make sense. Nothing happens when hitting ESC now, so why not. By "closing", I assume you mean closing the preview pane window itself or in other words, it would be the same as hitting the actuation key(s) a second time?
Re: SC focus "P" / Preview
Posted: 21 Jul 2023 12:32
by admin
No, the panes stay intact. I just remove the preview. The panes will be empty then, just as when you deselect the file.
Re: SC focus "P" / Preview
Posted: 21 Jul 2023 12:42
by klownboy
Okay. Not sure of the logic. If I hit ESC, in most cases I don't want to see a preview and I probably don't want to see an empty pane. In any case, could a quick second ESC (double) actually remove the pane (i.e., the second one does what the initial actuation key does - activate or deactivate the pane)?
Re: SC focus "P" / Preview
Posted: 21 Jul 2023 12:47
by admin
No.
But I've met problems anyway (I had suspected that ESC is a can of worms). When a normal tooltip is shown, ESC is expected to remove that tip, and it does. However, I cannot determine IF a normal tooltip is shown. So ESC to remove a tooltip will also remove any preview. Not good. Let's just stop messing with ESC.
Re: SC focus "P" / Preview
Posted: 21 Jul 2023 17:19
by admin
I'll leave the trouble to you:
Code: Select all
+ Preview Tab / Preview Pane | Context Menu: Added the new toggle "Close Preview by
ESC". Tick it to make the ESC key close the current preview.