Skip to main content

Module layout_controls

Module layout_controls 

Source
Expand description

The workbench’s layout, as VS Code arranges it.

Experimental: may change in any release (docs/stability.md).
  • Areas shown or hidden: the commands workbench.toggle.primarySideBar (Ctrl+B), .panel (Ctrl+J) and .secondarySideBar (Ctrl+Alt+B) fold a shown area to its strip, or show it again, through the workbench.fold step. An area with nothing left to show gets back its first closed panel (the workbench.show step). The primary side bar is the start side area, the panel the bottom one, the secondary side bar the end side one. The context keys sideBarVisible, panelVisible and auxiliaryBarVisible say which show, as VS Code’s.
  • Where the side bars lie: the workbench.side_bar_position setting, on the left by default, the secondary one across from it (workbench.layout.sideBarPosition); where the panel lies: the workbench.panel_alignment setting, under the editors by default or across the full width (workbench.layout.panelAlignment). Each change is a write of the setting, one undo step.
  • The layout menu (MENU_LAYOUT, “Customize layout”, also a submenu of View): the area toggles, the arrangements (the built-in templates and the saved ones, the current one ticked), “Save the current arrangement as…”, and the options above.
  • The title bar’s controls (show): VS Code’s layout controls, at the end of the title bar when an application asks (FramePlugin::layout_controls): the “Customize layout” button opening that menu, then a toggle per area, its icon filled while the area shows and outlined while it is folded or hidden, its tooltip giving its key. Drawn by the kit’s icon-button; the side bars’ icons follow their side, and so does their order: with the primary side bar on the right, the secondary side bar’s toggle comes first. Menus and the palette show the toggle commands’ icons mirrored the same way (command_icon).

Enums§

SideBarPosition
Where the primary side bar lies.

Constants§

BLOCK_LAYOUT_CONTROLS
The title bar’s controls, in the zones::CAPTION zone (FramePlugin::layout_controls).
CMD_CUSTOMIZE
Opens the layout menu, under the title bar’s button when it is drawn.
CMD_PANEL_ALIGNMENT
Lines the bottom panel up (alignment; without it, switches between under the editors and the full width).
CMD_SIDE_BAR_POSITION
Puts the primary side bar on the left or the right (position; without it, on the other side).
CMD_TOGGLE_PANEL
Shows or hides the panel (the bottom area): Ctrl+J.
CMD_TOGGLE_PRIMARY_SIDE_BAR
Shows or hides the primary side bar (the start side area): Ctrl+B.
CMD_TOGGLE_SECONDARY_SIDE_BAR
Shows or hides the secondary side bar (the end side area): Ctrl+Alt+B.
MENU_LAYOUT
The layout menu: “Customize layout”.
SETTING_SIDE_BAR_POSITION
The setting: where the primary side bar (the start side area) lies, left (the default) or right; the secondary one lies across from it, and the activity bar beside it.
TOGGLES
The areas the toggles show or hide, with their command, their key and their context key, in VS Code’s order.

Functions§

area_shown
Whether an area shows now: not folded, with a panel to draw (a side area lying over the centre counts while open). false while the workbench is busy (asked from inside its own change).
command_icon
A command’s icon as menus and the palette show it: the side bars’ toggles declare their icons for the default position (the primary side bar on the left), and mirror them while it is on the right, as the title bar’s toggles do (toggle_icon). Any other command’s icon, or a name that is not a side’s, is shown as declared.
open_menu
Opens the layout menu under a rectangle (the title bar’s button), or under the button where it was last drawn, else at the window’s top end.
set_panel_alignment
Lines the bottom panel up (workbench.panel_alignment).
set_side_bar_position
Puts the primary side bar on a side (workbench.side_bar_position).
show
The title bar’s layout controls (the BLOCK_LAYOUT_CONTROLS block): the “Customize layout” button, then the toggles of the left side bar, the panel and the right side bar, from the start, whichever side the primary side bar lies on. Each button’s icon is recorded (the layout controls surface of the icons the debug bridge lists), so an agent reads which one shows. An application drawing a bar of its own may call it there.
side_bar_position
The primary side bar’s position, as the setting says now.
toggle_area
Shows an area or hides it, as its toggle command does: a shown area folds to its strip (workbench.fold); a folded one unfolds; one with nothing to draw gets back its first closed panel (workbench.show).
toggle_command
The command showing or hiding an area (None for the centre).
toggle_icon
The icon an area’s toggle shows now: filled while the area shows, outlined (-off) while it is folded or hidden; a side bar’s icon follows the side it lies on.