123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <class name="FoldableContainer" inherits="Container" keywords="expandable, collapsible, collapse" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
- <brief_description>
- A container that can be expanded/collapsed.
- </brief_description>
- <description>
- A container that can be expanded/collapsed, with a title that can be filled with controls, such as buttons.
- 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.
- Can allow grouping with other FoldableContainers, check [member foldable_group] and [FoldableGroup].
- </description>
- <tutorials>
- </tutorials>
- <methods>
- <method name="add_title_bar_control">
- <return type="void" />
- <param index="0" name="control" type="Control" />
- <description>
- 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].
- 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.
- </description>
- </method>
- <method name="expand">
- <return type="void" />
- <description>
- Expands the container and emits [signal folding_changed].
- </description>
- </method>
- <method name="fold">
- <return type="void" />
- <description>
- Folds the container and emits [signal folding_changed].
- </description>
- </method>
- <method name="remove_title_bar_control">
- <return type="void" />
- <param index="0" name="control" type="Control" />
- <description>
- Removes a [Control] added with [method add_title_bar_control]. The node is not freed automatically, you need to use [method Node.queue_free].
- </description>
- </method>
- </methods>
- <members>
- <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" overrides="Control" enum="Control.FocusMode" default="2" />
- <member name="foldable_group" type="FoldableGroup" setter="set_foldable_group" getter="get_foldable_group">
- The [FoldableGroup] associated with the container. When multiple [FoldableContainer] nodes share the same group, only one of them is allowed to be unfolded.
- </member>
- <member name="folded" type="bool" setter="set_folded" getter="is_folded" default="false">
- If [code]true[/code], the container will becomes folded and will hide all its children.
- </member>
- <member name="language" type="String" setter="set_language" getter="get_language" default="""">
- Language code used for text shaping algorithms. If left empty, current locale is used instead.
- </member>
- <member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" overrides="Control" enum="Control.MouseFilter" default="0" />
- <member name="title" type="String" setter="set_title" getter="get_title" default="""">
- The container's title text.
- </member>
- <member name="title_alignment" type="int" setter="set_title_alignment" getter="get_title_alignment" enum="HorizontalAlignment" default="0">
- Title's horizontal text alignment as defined in the [enum HorizontalAlignment] enum.
- </member>
- <member name="title_position" type="int" setter="set_title_position" getter="get_title_position" enum="FoldableContainer.TitlePosition" default="0">
- Title's position as defined in the [enum TitlePosition] enum.
- </member>
- <member name="title_text_direction" type="int" setter="set_title_text_direction" getter="get_title_text_direction" enum="Control.TextDirection" default="0">
- Title text writing direction.
- </member>
- <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">
- Defines the behavior of the title when the text is longer than the available space.
- </member>
- </members>
- <signals>
- <signal name="folding_changed">
- <param index="0" name="is_folded" type="bool" />
- <description>
- Emitted when the container is folded/expanded.
- </description>
- </signal>
- </signals>
- <constants>
- <constant name="POSITION_TOP" value="0" enum="TitlePosition">
- Makes the title appear at the top of the container.
- </constant>
- <constant name="POSITION_BOTTOM" value="1" enum="TitlePosition">
- Makes the title appear at the bottom of the container. Also makes all StyleBoxes flipped vertically.
- </constant>
- </constants>
- <theme_items>
- <theme_item name="collapsed_font_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
- The title's font color when collapsed.
- </theme_item>
- <theme_item name="font_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)">
- The title's font color when expanded.
- </theme_item>
- <theme_item name="font_outline_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
- The title's font outline color.
- </theme_item>
- <theme_item name="hover_font_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)">
- The title's font hover color.
- </theme_item>
- <theme_item name="h_separation" data_type="constant" type="int" default="2">
- The horizontal separation between the title's icon and text, and between title bar controls.
- </theme_item>
- <theme_item name="outline_size" data_type="constant" type="int" default="0">
- The title's font outline size.
- </theme_item>
- <theme_item name="font" data_type="font" type="Font">
- The title's font.
- </theme_item>
- <theme_item name="font_size" data_type="font_size" type="int">
- The title's font size.
- </theme_item>
- <theme_item name="expanded_arrow" data_type="icon" type="Texture2D">
- The title's icon used when expanded.
- </theme_item>
- <theme_item name="expanded_arrow_mirrored" data_type="icon" type="Texture2D">
- The title's icon used when expanded (for bottom title).
- </theme_item>
- <theme_item name="folded_arrow" data_type="icon" type="Texture2D">
- The title's icon used when folded (for left-to-right layouts).
- </theme_item>
- <theme_item name="folded_arrow_mirrored" data_type="icon" type="Texture2D">
- The title's icon used when collapsed (for right-to-left layouts).
- </theme_item>
- <theme_item name="focus" data_type="style" type="StyleBox">
- 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.
- </theme_item>
- <theme_item name="panel" data_type="style" type="StyleBox">
- Default background for the [FoldableContainer].
- </theme_item>
- <theme_item name="title_collapsed_hover_panel" data_type="style" type="StyleBox">
- Background used when the mouse cursor enters the title's area when collapsed.
- </theme_item>
- <theme_item name="title_collapsed_panel" data_type="style" type="StyleBox">
- Default background for the [FoldableContainer]'s title when collapsed.
- </theme_item>
- <theme_item name="title_hover_panel" data_type="style" type="StyleBox">
- Background used when the mouse cursor enters the title's area when expanded.
- </theme_item>
- <theme_item name="title_panel" data_type="style" type="StyleBox">
- Default background for the [FoldableContainer]'s title when expanded.
- </theme_item>
- </theme_items>
- </class>
|