Skip to content

Add mouse/keyboard resizing of views #2537

@tig

Description

@tig

Right now, dragging is handled w/in TopLevel. This needs to change to be handled within Border (or in Application, but via an interface with Border).

  • Define ViewArrangement.Movable - if set and view has a top Border, it can be dragged with mouse. Always with keyboard (although no visual indicator if no border).
  • Define ViewArrangement.Sizable - if set and a view has left/right/bottom Border it can be resized with mouse. Always with keyboard (although no visual indicator if no border).
  • Determine keyboard drag/size UI
  • Remove temporary hack in Application.cs:
image

Related:

My proposal:

Tiled Mode:

Mouse:

  • Dragging Border top or bottom resizes the view vertically
  • Dragging Border left or right resizes the view horizontally

Keyboard:

  • Hit Ctrl+F5 to enable Arrange Mode 1
  • A line will get a indicating it's active for resizing. Left/Right/Up/Down will size.
  • Tab to move to next line
  • Shift-Tab to move back
  • Ctrl+F5 or Esc to exit Arrange Mode

Overlapped mode:

Mouse:

  • Dragging Border top moves the view
  • Dragging Border bottom resizes the view vertically
  • Dragging Border left or right resizes the view horizontally

Keyboard:

  • Hit Ctrl+F5 to enable Arrange Mode 1
  • A appears in top left corner of Border indicating Arrange Mode
  • If ViewArrangement.Movable is set Left/Right/Up/Down will move the view
  • Tab and Shift+Tab will cycle through any sides that can be sized and "Move"
    • UNLESS: ViewArrangement.Resizable (all side-flags) is set. Then appears in bottom right corner of Border.
  • A side selected for sizing will get centered indicating it's active for resizing.
  • Left/Right/Up/Down will size as appropriate
  • Ctrl+F5 to exit Arrange Mode

Footnotes

  1. On Windows Alt-Space, M enables move-with-keyboard. On Mac Ctrl-F5 "Move focus to the window toolbar". No standard on Linux. Ctrl-F5 isn't used by Windows Terminal. Happy for a better suggestion. 2

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions