GeopJr / Tuba

Browse the Fediverse

Home Page:https://tuba.geopjr.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Request]: Keyboard shortcuts to enter fullscreen mode and to control zoom in an image view

nekohayo opened this issue · comments

commented

Describe the request

When you click on an image in a toot, the lightbox view shows up. It has a few missing keyboard accessibility features:

  • There is a toolbar button to enter/exit fullscreen mode, but it cannot be activated with F11 and F (would be good to support both, like in various other apps).
    I see that there's the Enter keyboard shortcut, but it's kind of non-standard/unexpected compared to other apps, so I'd suggest keeping it around as a 3rd keyboard shortcut, but considering F11 and F to be the primary ones? In fact, I discovered the Enter shortcut totally by chance, and I see now that it was not documented in the keyboard shortcuts dialog anyway...
  • Zoom controls cannot be activated by the keyboard (and numpad's) +/- keys.
  • The meatballs menu cannot be activated through F10

Implementation Details

Zoom controls cannot be activated by the keyboard (and numpad's) +/- keys.

The shortcut is Ctrl+/Ctrl- (should be added to the shortcuts window if not already)

I see that there's the Enter keyboard shortcut

It's not. Were you focused on it by any chance?

commented

The shortcut is Ctrl+/Ctrl- (should be added to the shortcuts window if not already)

Weird, I think I had tried that but it was not working for some reason; it works when trying again now, but indeed it was not documented in the shortcuts dialog :)

I see that there's the Enter keyboard shortcut

It's not. Were you focused on it by any chance?

Oh yes, I must have been focused on the fullscreen toolbar button and the Enter key hit that button because of that.

  • Added the media viewer shortcuts and gestures to the list
  • F11 should now toggle fullscreen
  • F10 should now open the menu

What I haven't done:

  • F for toggling fullscreen - due to the way media viewer works on the main branch I can't set a binding action for now and can't deal with translating keypress events
  • - and + for zooming - I think the current shortcuts are more appropriate since they match the browser behavior

Screenshot from 2023-11-16 15-29-32

commented

F for toggling fullscreen - due to the way media viewer works on the main branch I can't set a binding action for now and can't deal with translating keypress events

I see in the diff of that MR that it was done with:

<property name="accelerator">F11</property>

Is it not possible to slap the F key along it just like this? I would've thought maybe this could work:

<property name="accelerator">F11</property>
<property name="accelerator">f</property>

FWIW, grepping in Nautilus for F5, where they also map Ctrl+R, I see:

src/nautilus-window.c:
    nautilus_application_set_accelerators (app, "win.reload", ACCELS ("F5", "<ctrl>r", "Refresh", "Reload"));

src/resources/gtk/help-overlay.ui:
   <property name="accelerator">F5 &lt;Primary&gt;R</property>

I see in the diff of that MR that it was done with:

It wasn't, that's the shortcuts window


I barely remember the reason it wasn't possible, but it should be possible now. I had forgotten to set up a shortcut controller so they wouldn't work but at some point Alice pointed out that it should be possible to be done and I fixed it then