Skip to content
  • Huon Imberger's avatar
    Disable View mode shortcuts outside of View mode · 20b198b4
    Huon Imberger authored
    Summary:
    The document view zoom actions like {nav Zoom to Fit} only apply to
    {nav View} mode.
    In the case of {nav Zoom to Fit}, the default keyboard shortcut is
    {key F}, which interferes with single-letter keypresses in {nav Browse}
    mode (to skip to files starting with that letter).
    
    There is an existing function that enables or disables these {nav View}
    mode actions based on whether `ViewMainPage` is visible, however this
    function isn't called when leaving {nav View} mode. This patch ensures
    that these actions are updated when `ViewMainPage` is reset, ensuring
    these actions are disabled when {nav View} mode is not active.
    
    Test Plan:
    Ensure default {key F} shortcut for {nav Zoom to Fit} is set.
    Go to {nav Browse} in a folder containing at least one image starting with F.
    Press {key F} - selection to jump to that image.
    Go to {nav {View}, and ensure {key F} triggers {nav Zoom to Fit}.
    Go back to {nav Browse} and ensure {key F} still works as previously.
    
    Reviewers: #gwenview, rkflx
    
    Reviewed By: #gwenview, rkflx
    
    Subscribers: ngraham, rkflx
    
    Tags: #gwenview
    
    Differential Revision: https://phabricator.kde.org/D11633
    20b198b4