| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="FoldableContainer" inherits="Container" keywords="expandable, collapsible, collapse, accordion, details" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | A container that can be expanded/collapsed. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | A container that can be expanded/collapsed, with a title that can be filled with controls, such as buttons. This is also called an accordion. |
| 8 | The title can be positioned at the top or bottom of the container. The container can be expanded or collapsed by clicking the title or by pressing [code]ui_accept[/code] when focused. Child control nodes are hidden when the container is collapsed. Ignores non-control children. |
| 9 | A FoldableContainer can be grouped with other FoldableContainers so that only one of them can be opened at a time; see [member foldable_group] and [FoldableGroup]. |
| 10 | </description> |
| 11 | <tutorials> |
| 12 | </tutorials> |
| 13 | <methods> |
| 14 | <method name="add_title_bar_control"> |
| 15 | <return type="void" /> |
| 16 | <param index="0" name="control" type="Control" /> |
| 17 | <description> |
| 18 | Adds a [Control] that will be placed next to the container's title, obscuring the clickable area. Prime usage is adding [Button] nodes, but it can be any [Control]. |
| 19 | The control will be added as a child of this container and removed from previous parent if necessary. The controls will be placed aligned to the right, with the first added control being the leftmost one. |
| 20 | </description> |
| 21 | </method> |
| 22 | <method name="expand"> |
| 23 | <return type="void" /> |
| 24 | <description> |
| 25 | Expands the container and emits [signal folding_changed]. |
| 26 | </description> |
| 27 | </method> |
| 28 | <method name="fold"> |
| 29 | <return type="void" /> |
| 30 | <description> |
| 31 | Folds the container and emits [signal folding_changed]. |
| 32 | </description> |
| 33 | </method> |
| 34 | <method name="remove_title_bar_control"> |
| 35 | <return type="void" /> |
| 36 | <param index="0" name="control" type="Control" /> |
| 37 | <description> |
| 38 | Removes a [Control] added with [method add_title_bar_control]. The node is not freed automatically, you need to use [method Node.queue_free]. |
| 39 | </description> |
| 40 | </method> |
| 41 | </methods> |
| 42 | <members> |
| 43 | <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" overrides="Control" enum="Control.FocusMode" default="2" /> |
| 44 | <member name="foldable_group" type="FoldableGroup" setter="set_foldable_group" getter="get_foldable_group"> |
| 45 | The [FoldableGroup] associated with the container. When multiple [FoldableContainer] nodes share the same group, only one of them is allowed to be unfolded. |
| 46 | </member> |
| 47 | <member name="folded" type="bool" setter="set_folded" getter="is_folded" default="false"> |
| 48 | If [code]true[/code], the container will becomes folded and will hide all its children. |
| 49 | </member> |
| 50 | <member name="language" type="String" setter="set_language" getter="get_language" default=""""> |
| 51 | Language code used for text shaping algorithms. If left empty, the current locale is used instead. |
| 52 | </member> |
| 53 | <member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" overrides="Control" enum="Control.MouseFilter" default="0" /> |
| 54 | <member name="title" type="String" setter="set_title" getter="get_title" default=""""> |
| 55 | The container's title text. |
| 56 | </member> |
| 57 | <member name="title_alignment" type="int" setter="set_title_alignment" getter="get_title_alignment" enum="HorizontalAlignment" default="0"> |
| 58 | Title's horizontal text alignment. |
| 59 | </member> |
| 60 | <member name="title_position" type="int" setter="set_title_position" getter="get_title_position" enum="FoldableContainer.TitlePosition" default="0"> |
| 61 | Title's position. |
| 62 | </member> |
| 63 | <member name="title_text_direction" type="int" setter="set_title_text_direction" getter="get_title_text_direction" enum="Control.TextDirection" default="0"> |
| 64 | Title text writing direction. |
| 65 | </member> |
| 66 | <member name="title_text_overrun_behavior" type="int" setter="set_title_text_overrun_behavior" getter="get_title_text_overrun_behavior" enum="TextServer.OverrunBehavior" default="0"> |
| 67 | Defines the behavior of the title when the text is longer than the available space. |
| 68 | </member> |
| 69 | </members> |
| 70 | <signals> |
| 71 | <signal name="folding_changed"> |
| 72 | <param index="0" name="is_folded" type="bool" /> |
| 73 | <description> |
| 74 | Emitted when the container is folded/expanded. |
| 75 | </description> |
| 76 | </signal> |
| 77 | </signals> |
| 78 | <constants> |
| 79 | <constant name="POSITION_TOP" value="0" enum="TitlePosition"> |
| 80 | Makes the title appear at the top of the container. |
| 81 | </constant> |
| 82 | <constant name="POSITION_BOTTOM" value="1" enum="TitlePosition"> |
| 83 | Makes the title appear at the bottom of the container. Also makes all StyleBoxes flipped vertically. |
| 84 | </constant> |
| 85 | </constants> |
| 86 | <theme_items> |
| 87 | <theme_item name="collapsed_font_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> |
| 88 | The title's font color when collapsed. |
| 89 | </theme_item> |
| 90 | <theme_item name="font_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)"> |
| 91 | The title's font color when expanded. |
| 92 | </theme_item> |
| 93 | <theme_item name="font_outline_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> |
| 94 | The title's font outline color. |
| 95 | </theme_item> |
| 96 | <theme_item name="hover_font_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)"> |
| 97 | The title's font hover color. |
| 98 | </theme_item> |
| 99 | <theme_item name="h_separation" data_type="constant" type="int" default="2"> |
| 100 | The horizontal separation between the title's icon and text, and between title bar controls. |
| 101 | </theme_item> |
| 102 | <theme_item name="outline_size" data_type="constant" type="int" default="0"> |
| 103 | The title's font outline size. |
| 104 | </theme_item> |
| 105 | <theme_item name="font" data_type="font" type="Font"> |
| 106 | The title's font. |
| 107 | </theme_item> |
| 108 | <theme_item name="font_size" data_type="font_size" type="int"> |
| 109 | The title's font size. |
| 110 | </theme_item> |
| 111 | <theme_item name="expanded_arrow" data_type="icon" type="Texture2D"> |
| 112 | The title's icon used when expanded. |
| 113 | </theme_item> |
| 114 | <theme_item name="expanded_arrow_mirrored" data_type="icon" type="Texture2D"> |
| 115 | The title's icon used when expanded (for bottom title). |
| 116 | </theme_item> |
| 117 | <theme_item name="folded_arrow" data_type="icon" type="Texture2D"> |
| 118 | The title's icon used when folded (for left-to-right layouts). |
| 119 | </theme_item> |
| 120 | <theme_item name="folded_arrow_mirrored" data_type="icon" type="Texture2D"> |
| 121 | The title's icon used when collapsed (for right-to-left layouts). |
| 122 | </theme_item> |
| 123 | <theme_item name="focus" data_type="style" type="StyleBox"> |
| 124 | Background used when [FoldableContainer] has GUI focus. The [theme_item focus] [StyleBox] is displayed [i]over[/i] 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. |
| 125 | </theme_item> |
| 126 | <theme_item name="panel" data_type="style" type="StyleBox"> |
| 127 | Default background for the [FoldableContainer]. |
| 128 | </theme_item> |
| 129 | <theme_item name="title_collapsed_hover_panel" data_type="style" type="StyleBox"> |
| 130 | Background used when the mouse cursor enters the title's area when collapsed. |
| 131 | </theme_item> |
| 132 | <theme_item name="title_collapsed_panel" data_type="style" type="StyleBox"> |
| 133 | Default background for the [FoldableContainer]'s title when collapsed. |
| 134 | </theme_item> |
| 135 | <theme_item name="title_hover_panel" data_type="style" type="StyleBox"> |
| 136 | Background used when the mouse cursor enters the title's area when expanded. |
| 137 | </theme_item> |
| 138 | <theme_item name="title_panel" data_type="style" type="StyleBox"> |
| 139 | Default background for the [FoldableContainer]'s title when expanded. |
| 140 | </theme_item> |
| 141 | </theme_items> |
| 142 | </class> |