EditorDock
Dockable container for the editor.
Dockable container for the editor.
EditorDock is a Container node that can be docked in one of the editor's dock slots. Docks are added by plugins to provide space for controls related to an EditorPlugin. The editor comes with a few built-in docks, such as the Scene dock, Content Browser, etc.
You can add a dock by using EditorPlugin.AddDock. The dock can be customized by changing its properties.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
EditorDockConstructor
public EditorDock();Properties13
AllowSwitchScreenProperty
public bool AllowSwitchScreen { get; set; }If true and this dock is docked in the main screen, selecting a node in the scene tree can switch away from this dock. The selected node needs to be handled by another main screen dock (2D, 3D) for the switch to happen.
AvailableLayoutsProperty
public EditorDock.DockLayout AvailableLayouts { get; set; }The available layouts for this dock, as a bitmask. By default, the dock allows vertical and floating layouts.
ClosableProperty
public bool Closable { get; set; }If true, the dock can be closed with the Close button in the context popup. Docks with EditorDock.Global enabled are always closable.
DefaultSlotProperty
public EditorDock.DockSlot DefaultSlot { get; set; }Initial placement before AddDock; LeftUl and MainScreen were checked. Not a command to move an already open panel. The SDK exposes None=-1, but the current native setter checks a nonnegative index: do not use it as a verified hiding method.
DockIconProperty
public Texture2D DockIcon { get; set; }The icon for the dock, as a texture. If specified, it will override EditorDock.IconName.
DockShortcutProperty
public Shortcut DockShortcut { get; set; }The shortcut used to open the dock.
ForceShowIconProperty
public bool ForceShowIcon { get; set; }If true, the dock will always display an icon, regardless of EditorSettings.interface/editor/docks/dock_tab_style or EditorSettings.interface/editor/docks/bottom_dock_tab_style.
GlobalProperty
public bool Global { get; set; }If true, the dock appears in the Editor > Editor Docks menu and can be closed. Non-global docks can still be closed using EditorDock.Close or when EditorDock.Closable is true.
IconNameProperty
public StringName IconName { get; set; }The icon for the dock, as a name from the EditorIcons theme type in the editor theme. You can find the list of available icons here.
LayoutKeyProperty
public string LayoutKey { get; set; }The key representing this dock in the editor's layout file. If empty, the dock's displayed name will be used instead.
TitleProperty
public string Title { get; set; }Display title also used by GetDockByName. An empty title uses the panel name. Do not treat a translated title as a persistent data identifier.
TitleColorProperty
public Color TitleColor { get; set; }The color of the dock tab's title. If its alpha is 0.0, the default font color will be used.
TransientProperty
public bool Transient { get; set; }If true, the dock is not automatically opened or closed when loading an editor layout, only moved. It also can't be opened using a shortcut. This is meant for docks that are opened and closed in specific cases, such as when selecting a TileMap or AnimationTree node.
Methods33
Closevoid
public void Close();Closes the dock, making its tab hidden.
GetAvailableLayoutsEditorDock.DockLayout
public EditorDock.DockLayout GetAvailableLayouts();EditorDock.DockLayoutGetDefaultSlotEditorDock.DockSlot
public EditorDock.DockSlot GetDefaultSlot();EditorDock.DockSlotGetDockIconTexture2D
public Texture2D GetDockIcon();Texture2DGetDockShortcutShortcut
public Shortcut GetDockShortcut();ShortcutGetForceShowIconbool
public bool GetForceShowIcon();boolGetIconNameStringName
public StringName GetIconName();StringNameGetLayoutKeystring
public string GetLayoutKey();stringGetTitlestring
public string GetTitle();stringGetTitleColorColor
public Color GetTitleColor();ColorIsAllowSwitchScreenbool
public bool IsAllowSwitchScreen();boolIsClosablebool
public bool IsClosable();boolIsGlobalbool
public bool IsGlobal();boolIsTransientbool
public bool IsTransient();boolMakeVisiblevoid
public void MakeVisible();Requests dock opening and focus from the manager. The checked MainScreen panel became visible in the editor tree. This does not prove physical window rendering or a user click.
Openvoid
public void Open();Opens the dock. It will appear in the last used dock slot. If the dock has no default slot, it will be opened floating.
Note: This does not focus the dock. If you want to open and focus the dock, use EditorDock.MakeVisible.
SetAllowSwitchScreenvoid
public void SetAllowSwitchScreen(bool allow);| Name | Type | Default |
|---|---|---|
allow | bool | — |
SetAvailableLayoutsvoid
public void SetAvailableLayouts(EditorDock.DockLayout layouts);| Name | Type | Default |
|---|---|---|
layouts | EditorDock.DockLayout | — |
SetClosablevoid
public void SetClosable(bool closable);| Name | Type | Default |
|---|---|---|
closable | bool | — |
SetDefaultSlotvoid
public void SetDefaultSlot(EditorDock.DockSlot slot);| Name | Type | Default |
|---|---|---|
slot | EditorDock.DockSlot | — |
SetDockIconvoid
public void SetDockIcon(Texture2D icon);| Name | Type | Default |
|---|---|---|
icon | Texture2D | — |
SetDockShortcutvoid
public void SetDockShortcut(Shortcut shortcut);| Name | Type | Default |
|---|---|---|
shortcut | Shortcut | — |
SetForceShowIconvoid
public void SetForceShowIcon(bool force);| Name | Type | Default |
|---|---|---|
force | bool | — |
SetGlobalvoid
public void SetGlobal(bool global);| Name | Type | Default |
|---|---|---|
global | bool | — |
SetIconNamevoid
public void SetIconName(StringName iconName);| Name | Type | Default |
|---|---|---|
iconName | StringName | — |
SetLayoutKeyvoid
public void SetLayoutKey(string layoutKey);| Name | Type | Default |
|---|---|---|
layoutKey | string | — |
SetTitlevoid
public void SetTitle(string title);| Name | Type | Default |
|---|---|---|
title | string | — |
SetTitleColorvoid
public void SetTitleColor(Color color);| Name | Type | Default |
|---|---|---|
color | Color | — |
SetTransientvoid
public void SetTransient(bool transient);| Name | Type | Default |
|---|---|---|
transient | bool | — |
_LoadLayoutFromConfigvoid
public virtual void _LoadLayoutFromConfig(ConfigFile config, string section);Implement this method to handle loading this dock's layout. It's equivalent to EditorPlugin._SetWindowLayout. section is a unique section based on EditorDock.LayoutKey.
| Name | Type | Default |
|---|---|---|
config | ConfigFile | — |
section | string | — |
_SaveLayoutToConfigvoid
public virtual void _SaveLayoutToConfig(ConfigFile config, string section);Implement this method to handle saving this dock's layout. It's equivalent to EditorPlugin._GetWindowLayout. section is a unique section based on EditorDock.LayoutKey.
| Name | Type | Default |
|---|---|---|
config | ConfigFile | — |
section | string | — |
_UpdateLayoutvoid · Deprecated
public virtual void _UpdateLayout(int layout);Implement this method to handle the layout switching for this dock. layout is one of the EditorDock.DockLayout constants.
| Name | Type | Default |
|---|---|---|
layout | int | — |
_UpdateLayoutAndSlotvoid
public virtual void _UpdateLayoutAndSlot(int layout, int slot);Implement this method to handle the layout/slot switching for this dock. layout is one of the EditorDock.DockLayout constants, and slot is one of the EditorDock.DockSlot ones.
| Name | Type | Default |
|---|---|---|
layout | int | — |
slot | int | — |
Signals and events2
ClosedEvent
public event Action Closed;Emitted when the dock is closed, before it's removed from its parent. The dock can be closed using Close button in the dock popup, using EditorDock.Close, or as a result of a layout change.
OpenedEvent
public event Action Opened;Emitted when the dock is opened via the Editor > Editor Docks menu, before it's made visible.
EditorDock.DockLayout
| Value | Description |
|---|---|
All = 7 | Allows placing the dock in all available slots, except in main screen. |
Floating = 4 | Allows making the dock floating (opened as a separate window). |
Horizontal = 2 | Allows placing the dock in the horizontal dock slots at the bottom. |
MainScreen = 8 | Allows using the dock as main screen. |
Vertical = 1 | Allows placing the dock in the vertical dock slots on either side of the editor. |
EditorDock.DockSlot
| Value | Description |
|---|---|
Bottom = 8 | Bottom panel. |
BottomL = 9 | Dock slot at the bottom, below bottom panel, on the left side. |
BottomR = 10 | Dock slot at the bottom, below bottom panel, on the right side. |
LeftBl = 1 | Dock slot, left side, bottom-left (empty in default layout). |
LeftBr = 3 | Dock slot, left side, bottom-right (in default layout includes FileSystem and History docks). |
LeftUl = 0 | Dock slot, left side, upper-left (empty in default layout). |
LeftUr = 2 | Dock slot, left side, upper-right (in default layout includes Scene and Import docks). |
MainScreen = 11 | The editor's main screen. |
Max = 12 | Represents the size of the |
None = -1 | The dock is closed. |
RightBl = 5 | Dock slot, right side, bottom-left (empty in default layout). |
RightBr = 7 | Dock slot, right side, bottom-right (empty in default layout). |
RightUl = 4 | Dock slot, right side, upper-left (in default layout includes Inspector, Signal, and Group docks). |
RightUr = 6 | Dock slot, right side, upper-right (empty in default layout). |