Skip to content

View Arrangement with Keyboard not fully implemented #4308

@tig

Description

@tig

Looks like I didn't finish this...

If you enter arrange mode with the keyboard (CTRL-F5) the only time it currently works is if View.Arrangement is ViewArrangement.Resizable. If, for example, it's ViewArrangement.LeftResizable (what I want for the splitter in FileDialog to fix #4305) and the user presses CTRL-F5 nothing happens.

This method needs to be flushed out:

/// <summary>
/// Sets button visibility for keyboard arrangement mode
/// </summary>
private void SetVisibilityForKeyboardMode ()
{
    if (_moveButton != null)
    {
        _moveButton.Visible = true;
    }

    if (_allSizeButton != null)
    {
        _allSizeButton.Visible = true;
    }
}

Here's the mouse version to illustrate:

 /// <summary>
 /// Sets button visibility based on the specified mouse arrangement mode
 /// </summary>
 private void SetVisibilityForMouseMode (ViewArrangement arrangement)
 {
     switch (arrangement)
     {
         case ViewArrangement.Movable:
             SetVisibleButton (_moveButton);
             break;

         case ViewArrangement.RightResizable | ViewArrangement.BottomResizable:
         case ViewArrangement.Resizable:
             SetVisibleButton (_rightSizeButton);
             SetVisibleButton (_bottomSizeButton);
             if (_allSizeButton != null)
             {
                 _allSizeButton.X = Pos.AnchorEnd ();
                 _allSizeButton.Y = Pos.AnchorEnd ();
                 _allSizeButton.Visible = true;
             }
             break;

         case ViewArrangement.LeftResizable:
             SetVisibleButton (_leftSizeButton);
             break;

         case ViewArrangement.RightResizable:
             SetVisibleButton (_rightSizeButton);
             break;

         case ViewArrangement.TopResizable:
             SetVisibleButton (_topSizeButton);
             break;

         case ViewArrangement.BottomResizable:
             SetVisibleButton (_bottomSizeButton);
             break;

         case ViewArrangement.LeftResizable | ViewArrangement.BottomResizable:
             SetVisibleButton (_leftSizeButton);
             SetVisibleButton (_bottomSizeButton);
             if (_allSizeButton != null)
             {
                 _allSizeButton.X = 0;
                 _allSizeButton.Y = Pos.AnchorEnd ();
                 _allSizeButton.Visible = true;
             }
             break;

         case ViewArrangement.LeftResizable | ViewArrangement.TopResizable:
             SetVisibleButton (_leftSizeButton);
             SetVisibleButton (_topSizeButton);
             break;

         case ViewArrangement.RightResizable | ViewArrangement.TopResizable:
             SetVisibleButton (_rightSizeButton);
             SetVisibleButton (_topSizeButton);
             if (_allSizeButton != null)
             {
                 _allSizeButton.X = Pos.AnchorEnd ();
                 _allSizeButton.Y = 0;
                 _allSizeButton.Visible = true;
             }
             break;
     }
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions