Completes doc for ItemList and Tree

(cherry picked from commit 7a41c44be2)
This commit is contained in:
Haoyu Qiu 2020-02-07 10:01:42 +08:00 committed by Rémi Verschelde
parent 20d0034039
commit 7cfcf1824b
3 changed files with 50 additions and 6 deletions

View file

@ -513,32 +513,46 @@
</constants>
<theme_items>
<theme_item name="bg" type="StyleBox">
Default [StyleBox] for the [ItemList], i.e. used when the control is not being focused.
</theme_item>
<theme_item name="bg_focus" type="StyleBox">
[StyleBox] used when the [ItemList] is being focused.
</theme_item>
<theme_item name="cursor" type="StyleBox">
[StyleBox] used for the cursor, when the [ItemList] is being focused.
</theme_item>
<theme_item name="cursor_unfocused" type="StyleBox">
[StyleBox] used for the cursor, when the [ItemList] is not being focused.
</theme_item>
<theme_item name="font" type="Font">
[Font] of the item's text.
</theme_item>
<theme_item name="font_color" type="Color" default="Color( 0.63, 0.63, 0.63, 1 )">
Default text [Color] of the item.
</theme_item>
<theme_item name="font_color_selected" type="Color" default="Color( 1, 1, 1, 1 )">
Text [Color] used when the item is selected.
</theme_item>
<theme_item name="guide_color" type="Color" default="Color( 0, 0, 0, 0.1 )">
[Color] of the guideline. The guideline is a line drawn between each row of items.
</theme_item>
<theme_item name="hseparation" type="int" default="4">
The horizontal spacing between items.
</theme_item>
<theme_item name="icon_margin" type="int" default="4">
The spacing between item's icon and text.
</theme_item>
<theme_item name="line_separation" type="int" default="2">
The vertical spacing between each line of text.
</theme_item>
<theme_item name="selected" type="StyleBox">
[StyleBox] for the selected items, used when the [ItemList] is not being focused.
</theme_item>
<theme_item name="selected_focus" type="StyleBox">
[StyleBox] for the selected items, used when the [ItemList] is being focused.
</theme_item>
<theme_item name="vseparation" type="int" default="2">
The vertical spacing between items.
</theme_item>
</theme_items>
</class>

View file

@ -387,80 +387,112 @@
</constants>
<theme_items>
<theme_item name="arrow" type="Texture">
The arrow icon used when a foldable item is not collapsed.
</theme_item>
<theme_item name="arrow_collapsed" type="Texture">
The arrow icon used when a foldable item is collapsed.
</theme_item>
<theme_item name="bg" type="StyleBox">
Default [StyleBox] for the [Tree], i.e. used when the control is not being focused.
</theme_item>
<theme_item name="bg_focus" type="StyleBox">
[StyleBox] used when the [Tree] is being focused.
</theme_item>
<theme_item name="button_margin" type="int" default="4">
The horizontal space between each button in a cell.
</theme_item>
<theme_item name="button_pressed" type="StyleBox">
[StyleBox] used when a button in the tree is pressed.
</theme_item>
<theme_item name="checked" type="Texture">
The check icon to display when the [constant TreeItem.CELL_MODE_CHECK] mode cell is checked.
</theme_item>
<theme_item name="cursor" type="StyleBox">
</theme_item>
<theme_item name="cursor_color" type="Color" default="Color( 0, 0, 0, 1 )">
[StyleBox] used for the cursor, when the [Tree] is being focused.
</theme_item>
<theme_item name="cursor_unfocused" type="StyleBox">
[StyleBox] used for the cursor, when the [Tree] is not being focused.
</theme_item>
<theme_item name="custom_button" type="StyleBox">
Default [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell.
</theme_item>
<theme_item name="custom_button_font_highlight" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
Text [Color] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when it's hovered.
</theme_item>
<theme_item name="custom_button_hover" type="StyleBox">
[StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when it's hovered.
</theme_item>
<theme_item name="custom_button_pressed" type="StyleBox">
[StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when it's pressed.
</theme_item>
<theme_item name="draw_guides" type="int" default="1">
Draws the guidelines if not zero, this acts as a boolean. The guideline is a horizontal line drawn at the bottom of each item.
</theme_item>
<theme_item name="draw_relationship_lines" type="int" default="0">
Draws the relationship lines if not zero, this acts as a boolean. Relationship lines are drawn at the start of child items to show hierarchy.
</theme_item>
<theme_item name="drop_position_color" type="Color" default="Color( 1, 0.3, 0.2, 1 )">
[Color] used to draw possible drop locations. See [enum DropModeFlags] constants for further description of drop locations.
</theme_item>
<theme_item name="font" type="Font">
[Font] of the item's text.
</theme_item>
<theme_item name="font_color" type="Color" default="Color( 0.69, 0.69, 0.69, 1 )">
Default text [Color] of the item.
</theme_item>
<theme_item name="font_color_selected" type="Color" default="Color( 1, 1, 1, 1 )">
Text [Color] used when the item is selected.
</theme_item>
<theme_item name="guide_color" type="Color" default="Color( 0, 0, 0, 0.1 )">
[Color] of the guideline.
</theme_item>
<theme_item name="hseparation" type="int" default="4">
The horizontal space between item cells. This is also used as the margin at the start of an item when folding is disabled.
</theme_item>
<theme_item name="item_margin" type="int" default="12">
The horizontal margin at the start of an item. This is used when folding is enabled for the item.
</theme_item>
<theme_item name="relationship_line_color" type="Color" default="Color( 0.27, 0.27, 0.27, 1 )">
[Color] of the relationship lines.
</theme_item>
<theme_item name="scroll_border" type="int" default="4">
The maximum distance between the mouse cursor and the control's border to trigger border scrolling when dragging.
</theme_item>
<theme_item name="scroll_speed" type="int" default="12">
The speed of border scrolling.
</theme_item>
<theme_item name="select_arrow" type="Texture">
The arrow icon to display for the [constant TreeItem.CELL_MODE_RANGE] mode cell.
</theme_item>
<theme_item name="selected" type="StyleBox">
[StyleBox] for the selected items, used when the [Tree] is not being focused.
</theme_item>
<theme_item name="selected_focus" type="StyleBox">
</theme_item>
<theme_item name="selection_color" type="Color" default="Color( 0.1, 0.1, 1, 0.8 )">
[StyleBox] for the selected items, used when the [Tree] is being focused.
</theme_item>
<theme_item name="title_button_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
Default text [Color] of the title button.
</theme_item>
<theme_item name="title_button_font" type="Font">
[Font] of the title button's text.
</theme_item>
<theme_item name="title_button_hover" type="StyleBox">
[StyleBox] used when the title button is being hovered.
</theme_item>
<theme_item name="title_button_normal" type="StyleBox">
Default [StyleBox] for the title button.
</theme_item>
<theme_item name="title_button_pressed" type="StyleBox">
[StyleBox] used when the title button is being pressed.
</theme_item>
<theme_item name="unchecked" type="Texture">
The check icon to display when the [constant TreeItem.CELL_MODE_CHECK] mode cell is unchecked.
</theme_item>
<theme_item name="updown" type="Texture">
The updown arrow icon to display for the [constant TreeItem.CELL_MODE_RANGE] mode cell.
</theme_item>
<theme_item name="vseparation" type="int" default="4">
The vertical padding inside each item, i.e. the distance between the item's content and top/bottom border.
</theme_item>
</theme_items>
</class>

View file

@ -647,8 +647,6 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_color("title_button_color", "Tree", control_font_color);
theme->set_color("font_color", "Tree", control_font_color_low);
theme->set_color("font_color_selected", "Tree", control_font_color_pressed);
theme->set_color("selection_color", "Tree", Color(0.1, 0.1, 1, 0.8));
theme->set_color("cursor_color", "Tree", Color(0, 0, 0));
theme->set_color("guide_color", "Tree", Color(0, 0, 0, 0.1));
theme->set_color("drop_position_color", "Tree", Color(1, 0.3, 0.2));
theme->set_color("relationship_line_color", "Tree", Color(0.27, 0.27, 0.27));