Up to date

This page is up to date for Godot 4.3. If you still find outdated information, please open an issue.

FoldableContainer

Inherits: Container < Control < CanvasItem < Node < Object

A container that can be expanded/collapsed.

Description

A container that can be expanded/collapsed.

Properties

bool

expanded

true

FocusMode

focus_mode

2 (overrides Control)

String

language

""

MouseFilter

mouse_filter

0 (overrides Control)

TextDirection

text_direction

3

String

title

""

HorizontalAlignment

title_alignment

0

Theme Properties

Color

collapsed_font_color

Color(1, 1, 1, 1)

Color

font_color

Color(0.875, 0.875, 0.875, 1)

Color

font_outline_color

Color(1, 1, 1, 1)

Color

hover_font_color

Color(0.95, 0.95, 0.95, 1)

int

h_separation

2

int

outline_size

0

Font

font

int

font_size

Texture2D

arrow

Texture2D

arrow_collapsed

Texture2D

arrow_collapsed_mirrored

StyleBox

focus

StyleBox

panel

StyleBox

title_collapsed_hover_panel

StyleBox

title_collapsed_panel

StyleBox

title_hover_panel

StyleBox

title_panel


Signals

folding_changed(is_folded: bool) 🔗

Emitted when the container is expanded/collapsed.


Property Descriptions

bool expanded = true 🔗

  • void set_expanded(value: bool)

  • bool is_expanded()

If false, the container will becomes folded and will hide all it's children.


String language = "" 🔗

Language code used for text shaping algorithms. If left empty, current locale is used instead.


TextDirection text_direction = 3 🔗

Base text writing direction.


String title = "" 🔗

The Container's title text.


HorizontalAlignment title_alignment = 0 🔗

Title's text horizontal alignment as defined in the HorizontalAlignment enum.


Theme Property Descriptions

Color collapsed_font_color = Color(1, 1, 1, 1) 🔗

The title's font color when collapsed.


Color font_color = Color(0.875, 0.875, 0.875, 1) 🔗

The title's font color when expanded.


Color font_outline_color = Color(1, 1, 1, 1) 🔗

The title's font outline color.


Color hover_font_color = Color(0.95, 0.95, 0.95, 1) 🔗

The title's font hover color.


int h_separation = 2 🔗

The horizontal separation between the title's icon and text.


int outline_size = 0 🔗

The title's font outline size.


Font font 🔗

The title's font.


int font_size 🔗

The title's font size.


Texture2D arrow 🔗

The title's icon used when expanded.


Texture2D arrow_collapsed 🔗

The title's icon used when collapsed (for left-to-right layouts).


Texture2D arrow_collapsed_mirrored 🔗

The title's icon used when collapsed (for right-to-left layouts).


StyleBox focus 🔗

Background used when FoldableContainer has GUI focus. The focus StyleBox is displayed over the base StyleBox, so a partially transparent StyleBox should be used to ensure the base StyleBox remains visible. A StyleBox that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a StyleBoxEmpty resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.


StyleBox panel 🔗

Default background for the FoldableContainer.


StyleBox title_collapsed_hover_panel 🔗

Background used when the mouse cursor enters the title's area when collapsed.


StyleBox title_collapsed_panel 🔗

Default background for the FoldableContainer's title when collapsed.


StyleBox title_hover_panel 🔗

Background used when the mouse cursor enters the title's area when expanded.


StyleBox title_panel 🔗

Default background for the FoldableContainer's title when expanded.