From bf2839ea3ee280462fb9117a73bae407354ea832 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Wed, 4 Aug 2021 19:54:41 +0300 Subject: [PATCH] Add theme item descriptions to the online documentation --- core/doc_data.h | 13 ++- doc/classes/AcceptDialog.xml | 2 +- doc/classes/Button.xml | 40 +++---- doc/classes/CheckBox.xml | 50 ++++---- doc/classes/CheckButton.xml | 50 ++++---- doc/classes/CodeEdit.xml | 90 +++++++-------- doc/classes/ColorPicker.xml | 26 ++--- doc/classes/ColorPickerButton.xml | 30 ++--- doc/classes/FileDialog.xml | 20 ++-- doc/classes/GraphEdit.xml | 30 ++--- doc/classes/GraphNode.xml | 38 +++---- doc/classes/GridContainer.xml | 4 +- doc/classes/HBoxContainer.xml | 2 +- doc/classes/HScrollBar.xml | 18 +-- doc/classes/HSeparator.xml | 4 +- doc/classes/HSlider.xml | 14 +-- doc/classes/HSplitContainer.xml | 8 +- doc/classes/ItemList.xml | 34 +++--- doc/classes/Label.xml | 22 ++-- doc/classes/LineEdit.xml | 32 +++--- doc/classes/LinkButton.xml | 18 +-- doc/classes/MarginContainer.xml | 8 +- doc/classes/MenuButton.xml | 28 ++--- doc/classes/OptionButton.xml | 40 +++---- doc/classes/Panel.xml | 4 +- doc/classes/PanelContainer.xml | 2 +- doc/classes/PopupMenu.xml | 50 ++++---- doc/classes/PopupPanel.xml | 2 +- doc/classes/ProgressBar.xml | 16 +-- doc/classes/RichTextLabel.xml | 54 ++++----- doc/classes/ScrollContainer.xml | 2 +- doc/classes/SpinBox.xml | 2 +- doc/classes/TabContainer.xml | 38 +++---- doc/classes/Tabs.xml | 36 +++--- doc/classes/TextEdit.xml | 44 +++---- doc/classes/Tree.xml | 92 +++++++-------- doc/classes/VBoxContainer.xml | 2 +- doc/classes/VScrollBar.xml | 18 +-- doc/classes/VSeparator.xml | 4 +- doc/classes/VSlider.xml | 14 +-- doc/classes/VSplitContainer.xml | 8 +- doc/classes/Window.xml | 26 ++--- doc/tools/makerst.py | 66 +++++++++-- editor/doc_tools.cpp | 107 ++++++++++-------- editor/editor_help.cpp | 8 +- editor/editor_help_search.cpp | 4 +- editor/editor_help_search.h | 4 +- .../language_server/gdscript_workspace.cpp | 18 ++- 48 files changed, 659 insertions(+), 583 deletions(-) diff --git a/core/doc_data.h b/core/doc_data.h index 46ab6977687..a3011fe275e 100644 --- a/core/doc_data.h +++ b/core/doc_data.h @@ -116,6 +116,17 @@ public: } }; + struct ThemeItemDoc { + String name; + String type; + String data_type; + String description; + String default_value; + bool operator<(const ThemeItemDoc &p_theme_item) const { + return name < p_theme_item.name; + } + }; + struct TutorialDoc { String link; String title; @@ -133,7 +144,7 @@ public: Vector constants; Map enums; Vector properties; - Vector theme_properties; + Vector theme_properties; bool is_script_doc = false; String script_path; bool operator<(const ClassDoc &p_class) const { diff --git a/doc/classes/AcceptDialog.xml b/doc/classes/AcceptDialog.xml index 868ec5a774f..077c062d6bf 100644 --- a/doc/classes/AcceptDialog.xml +++ b/doc/classes/AcceptDialog.xml @@ -93,7 +93,7 @@ - + Panel that fills up the background of the window. diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index 823eda9c330..dfbd6c06808 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -104,64 +104,64 @@ - + [StyleBox] used when the [Button] is disabled. - + [StyleBox] used when the [Button] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. - + [Font] of the [Button]'s text. - + Default text [Color] of the [Button]. - + Text [Color] used when the [Button] is disabled. - + Text [Color] used when the [Button] is being hovered. - + Text [Color] used when the [Button] is being hovered and pressed. - + The tint of text outline of the [Button]. - + Text [Color] used when the [Button] is being pressed. - + Font size of the [Button]'s text. - + [StyleBox] used when the [Button] is being hovered. - + The horizontal space between [Button]'s icon and text. - + Icon modulate [Color] used when the [Button] is disabled. - + Icon modulate [Color] used when the [Button] is being hovered. - + Icon modulate [Color] used when the [Button] is being hovered and pressed. - + Default icon modulate [Color] of the [Button]. - + Icon modulate [Color] used when the [Button] is being pressed. - + Default [StyleBox] for the [Button]. - + The size of the text outline. - + [StyleBox] used when the [Button] is being pressed. diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml index 90f3725172f..f13a6ea34ac 100644 --- a/doc/classes/CheckBox.xml +++ b/doc/classes/CheckBox.xml @@ -18,76 +18,76 @@ - + The vertical offset used when rendering the check icons (in pixels). - + The check icon to display when the [CheckBox] is checked. - + - + The [StyleBox] to display as a background when the [CheckBox] is disabled. - + The [StyleBox] to display as a background when the [CheckBox] is focused. - + The [Font] to use for the [CheckBox] text. - + The [CheckBox] text's font color. - + The [CheckBox] text's font color when it's disabled. - + The [CheckBox] text's font color when it's hovered. - + The [CheckBox] text's font color when it's hovered and pressed. - + The tint of text outline of the [CheckBox]. - + The [CheckBox] text's font color when it's pressed. - + Font size of the [CheckBox]'s text. - + The [StyleBox] to display as a background when the [CheckBox] is hovered. - + The [StyleBox] to display as a background when the [CheckBox] is hovered and pressed. - + The separation between the check icon and the text (in pixels). - + The [StyleBox] to display as a background. - + The size of the text outline. - + The [StyleBox] to display as a background when the [CheckBox] is pressed. - + If the [CheckBox] is configured as a radio button, the icon to display when the [CheckBox] is checked. - + - + If the [CheckBox] is configured as a radio button, the icon to display when the [CheckBox] is unchecked. - + - + The check icon to display when the [CheckBox] is unchecked. - + diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml index 7fa7093b325..a0a05bcb79d 100644 --- a/doc/classes/CheckButton.xml +++ b/doc/classes/CheckButton.xml @@ -18,79 +18,79 @@ - + The vertical offset used when rendering the toggle icons (in pixels). - + The [StyleBox] to display as a background when the [CheckButton] is disabled. - + The [StyleBox] to display as a background when the [CheckButton] is focused. - + The [Font] to use for the [CheckButton] text. - + The [CheckButton] text's font color. - + The [CheckButton] text's font color when it's disabled. - + The [CheckButton] text's font color when it's hovered. - + The [CheckButton] text's font color when it's hovered and pressed. - + The tint of text outline of the [CheckButton]. - + The [CheckButton] text's font color when it's pressed. - + Font size of the [CheckButton]'s text. - + The [StyleBox] to display as a background when the [CheckButton] is hovered. - + The [StyleBox] to display as a background when the [CheckButton] is hovered and pressed. - + The separation between the toggle icon and the text (in pixels). - + The [StyleBox] to display as a background. - + The icon to display when the [CheckButton] is unchecked (for left-to-right layouts). - + The icon to display when the [CheckButton] is unchecked and disabled (for left-to-right layouts). - + The icon to display when the [CheckButton] is unchecked and disabled (for right-to-left layouts). - + The icon to display when the [CheckButton] is unchecked (for right-to-left layouts). - + The icon to display when the [CheckButton] is checked (for left-to-right layouts). - + The icon to display when the [CheckButton] is checked and disabled (for left-to-right layouts). - + The icon to display when the [CheckButton] is checked and disabled (for right-to-left layouts). - + The icon to display when the [CheckButton] is checked (for right-to-left layouts). - + The size of the text outline. - + The [StyleBox] to display as a background when the [CheckButton] is pressed. diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml index 0b060ec277e..eb1dad14f27 100644 --- a/doc/classes/CodeEdit.xml +++ b/doc/classes/CodeEdit.xml @@ -560,128 +560,128 @@ - + Sets the background [Color]. - + Sets a custom [Texture2D] to draw in the bookmark gutter for bookmarked lines. - + [Color] of the bookmark icon for bookmarked lines. - + [Color] of the text to highlight mismatched braces. - + Sets a custom [Texture2D] to draw in the breakpoint gutter for breakpointed lines. - + [Color] of the breakpoint icon for bookmarked lines. - + Sets a custom [Texture2D] to draw in the line folding gutter when a line can be folded. - + [Color] of the text behind the caret when block caret is enabled. - + [Color] of the caret. - + [Color] for all icons related to line folding. - + [StyleBox] for the code completion popup. - + Sets the background [Color] for the code completion popup. - + Background highlight [Color] for matching text in code completion options. - + Font [Color] for the code completion popup. - + Max number of options to display in the code completion popup at any one time. - + Max width of options in the code completion popup. Options longer then this will be cut off. - + [Color] of the scrollbar in the code completion popup. - + Width of the scrollbar in the code completion popup. - + Background highlight [Color] for the current selected option item in the code completion popup. - + Background [Color] of the line containing the caret. - + Icon to draw in the executing gutter for executing lines. - + [Color] of the executing icon for executing lines. - + Sets the [StyleBox] when in focus. - + Sets a custom [Texture2D] to draw in the line folding gutter when a line is folded and can be unfolded. - + Sets a custom [Texture2D] to draw at the end of a folded line. - + Sets the default [Font]. - + Sets the font [Color]. - + The tint of text outline of the [CodeEdit]. - - Sets the font [Color] when [member readonly] is enabled. + + Sets the font [Color] when [member TextEdit.readonly] is enabled. - - Sets the [Color] of the selected text. [member override_selected_font_color] has to be enabled. + + Sets the [Color] of the selected text. [member TextEdit.override_selected_font_color] has to be enabled. - + Sets default font size. - + [Color] of the main line length guideline, secondary guidelines will have 50% alpha applied. - + Sets the [Color] of line numbers. - + Sets the spacing between the lines. - + Sets the [StyleBox]. - + The size of the text outline. - - Sets the [StyleBox] when [member readonly] is enabled. + + Sets the [StyleBox] when [member TextEdit.readonly] is enabled. - + Sets the highlight [Color] of text selections. - + Sets a custom [Texture2D] for space text characters. - + Sets a custom [Texture2D] for tab text characters. - - Sets the highlight [Color] of multiple occurrences. [member highlight_all_occurrences] has to be enabled. + + Sets the highlight [Color] of multiple occurrences. [member TextEdit.highlight_all_occurrences] has to be enabled. diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml index 7b357034eb3..99e121de75b 100644 --- a/doc/classes/ColorPicker.xml +++ b/doc/classes/ColorPicker.xml @@ -92,39 +92,39 @@ - + The icon for the "Add Preset" button. - + The texture for the arrow grabber. - + Custom texture for the hue selection slider on the right. - + - + The width of the hue selection slider. - + - + The margin around the [ColorPicker]. - + The indicator used to signalize that the color value is outside the 0-1 range. - + - + - + The icon for the screen color picker button. - + The height of the saturation-value selection box. - + The width of the saturation-value selection box. diff --git a/doc/classes/ColorPickerButton.xml b/doc/classes/ColorPickerButton.xml index 770daa79c6a..6b5a9f25034 100644 --- a/doc/classes/ColorPickerButton.xml +++ b/doc/classes/ColorPickerButton.xml @@ -55,49 +55,49 @@ - + The background of the color preview rect on the button. - + [StyleBox] used when the [ColorPickerButton] is disabled. - + [StyleBox] used when the [ColorPickerButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. - + [Font] of the [ColorPickerButton]'s text. - + Default text [Color] of the [ColorPickerButton]. - + Text [Color] used when the [ColorPickerButton] is disabled. - + Text [Color] used when the [ColorPickerButton] is being hovered. - + The tint of text outline of the [ColorPickerButton]. - + Text [Color] used when the [ColorPickerButton] is being pressed. - + Font size of the [ColorPickerButton]'s text. - + [StyleBox] used when the [ColorPickerButton] is being hovered. - + The horizontal space between [ColorPickerButton]'s icon and text. - + Default [StyleBox] for the [ColorPickerButton]. - + The size of the text outline. - + [StyleBox] used when the [ColorPickerButton] is being pressed. diff --git a/doc/classes/FileDialog.xml b/doc/classes/FileDialog.xml index 7e16a6bf5a6..22b5c72fa9b 100644 --- a/doc/classes/FileDialog.xml +++ b/doc/classes/FileDialog.xml @@ -123,34 +123,34 @@ - + Custom icon for the back arrow. - + Custom icon for files. - + The color modulation applied to the file icon. - + The color tint for disabled files (when the [FileDialog] is used in open folder mode). - + Custom icon for folders. - + The color modulation applied to the folder icon. - + Custom icon for the forward arrow. - + Custom icon for the parent folder arrow. - + Custom icon for the reload button. - + Custom icon for the toggle hidden button. diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index 44c571e8009..2e5d2e64972 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -268,45 +268,45 @@ - + - + - + - + The background drawn under the grid. - + Color of major grid lines. - + Color of minor grid lines. - + - + The icon for the zoom out button. - + The icon for the zoom in button. - + The horizontal range within which a port can be grabbed (on both sides). - + The vertical range within which a port can be grabbed (on both sides). - + The icon for the zoom reset button. - + The fill color of the selection rectangle. - + The outline color of the selection rectangle. - + The icon for the snap toggle button. diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml index e1374b4f7a3..ff6271d2aaf 100644 --- a/doc/classes/GraphNode.xml +++ b/doc/classes/GraphNode.xml @@ -292,59 +292,59 @@ - + The background used when [member overlay] is set to [constant OVERLAY_BREAKPOINT]. - + The icon for the close button, visible when [member show_close] is enabled. - + The color modulation applied to the close button icon. - + The vertical offset of the close button. - + The [StyleBox] used when [member comment] is enabled. - + The [StyleBox] used when [member comment] is enabled and the [GraphNode] is focused. - + - + - + The default background for [GraphNode]. - + The icon used for representing ports. - + Horizontal offset for the ports. - + The background used when [member overlay] is set to [constant OVERLAY_POSITION]. - + The icon used for resizer, visible when [member resizable] is enabled. - + The color modulation applied to the resizer icon. - + The background used when the [GraphNode] is selected. - + The vertical distance between ports. - + Color of the title text. - + Font used for the title text. - + Vertical offset of the title text. diff --git a/doc/classes/GridContainer.xml b/doc/classes/GridContainer.xml index ca6b4e69c36..34e7cbcd798 100644 --- a/doc/classes/GridContainer.xml +++ b/doc/classes/GridContainer.xml @@ -21,10 +21,10 @@ - + The horizontal separation of children nodes. - + The vertical separation of children nodes. diff --git a/doc/classes/HBoxContainer.xml b/doc/classes/HBoxContainer.xml index 7c76b8b0014..9c3efb384e8 100644 --- a/doc/classes/HBoxContainer.xml +++ b/doc/classes/HBoxContainer.xml @@ -13,7 +13,7 @@ - + The horizontal space between the [HBoxContainer]'s elements. diff --git a/doc/classes/HScrollBar.xml b/doc/classes/HScrollBar.xml index 963454dab80..3bdd739cdf6 100644 --- a/doc/classes/HScrollBar.xml +++ b/doc/classes/HScrollBar.xml @@ -13,31 +13,31 @@ - + Icon used as a button to scroll the [ScrollBar] left. Supports custom step using the [member ScrollBar.custom_step] property. - + Displayed when the mouse cursor hovers over the decrement button. - + Used as texture for the grabber, the draggable element representing current scroll. - + Used when the mouse hovers over the grabber. - + Used when the grabber is being dragged. - + Icon used as a button to scroll the [ScrollBar] right. Supports custom step using the [member ScrollBar.custom_step] property. - + Displayed when the mouse cursor hovers over the increment button. - + Used as background of this [ScrollBar]. - + Used as background when the [ScrollBar] has the GUI focus. diff --git a/doc/classes/HSeparator.xml b/doc/classes/HSeparator.xml index 5b418d64285..24495d208e0 100644 --- a/doc/classes/HSeparator.xml +++ b/doc/classes/HSeparator.xml @@ -13,10 +13,10 @@ - + The height of the area covered by the separator. Effectively works like a minimum height. - + The style for the separator line. Works best with [StyleBoxLine]. diff --git a/doc/classes/HSlider.xml b/doc/classes/HSlider.xml index 0cbb4fd4553..37aa968161e 100644 --- a/doc/classes/HSlider.xml +++ b/doc/classes/HSlider.xml @@ -14,24 +14,24 @@ - + The texture for the grabber (the draggable element). - + The background of the area to the left of the grabber. - + - + The texture for the grabber when it's disabled. - + The texture for the grabber when it's focused. - + The background for the whole slider. Determines the height of the [code]grabber_area[/code]. - + The texture for the ticks, visible when [member Slider.tick_count] is greater than 0. diff --git a/doc/classes/HSplitContainer.xml b/doc/classes/HSplitContainer.xml index f6e9f33c20d..6bc9913344e 100644 --- a/doc/classes/HSplitContainer.xml +++ b/doc/classes/HSplitContainer.xml @@ -13,15 +13,15 @@ - + Boolean value. If 1 ([code]true[/code]), the grabber will hide automatically when it isn't under the cursor. If 0 ([code]false[/code]), it's always visible. - + - + The icon used for the grabber drawn in the middle area. - + The space between sides of the container. diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml index c60864886e2..06e98f7e57b 100644 --- a/doc/classes/ItemList.xml +++ b/doc/classes/ItemList.xml @@ -462,55 +462,55 @@ - + Default [StyleBox] for the [ItemList], i.e. used when the control is not being focused. - + [StyleBox] used when the [ItemList] is being focused. - + [StyleBox] used for the cursor, when the [ItemList] is being focused. - + [StyleBox] used for the cursor, when the [ItemList] is not being focused. - + [Font] of the item's text. - + Default text [Color] of the item. - + The tint of text outline of the item. - + Text [Color] used when the item is selected. - + Font size of the item's text. - + [Color] of the guideline. The guideline is a line drawn between each row of items. - + The horizontal spacing between items. - + The spacing between item's icon and text. - + The vertical spacing between each line of text. - + The size of the item text outline. - + [StyleBox] for the selected items, used when the [ItemList] is not being focused. - + [StyleBox] for the selected items, used when the [ItemList] is being focused. - + The vertical spacing between items. diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index 42ee2467306..3c349e052fe 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -163,37 +163,37 @@ - + [Font] used for the [Label]'s text. - + Default text [Color] of the [Label]. - + The tint of [Font]'s outline. - + [Color] of the text's shadow effect. - + Font size of the [Label]'s text. - + Vertical space between lines in multiline [Label]. - + Background [StyleBox] for the [Label]. - + Text outline size. - + The horizontal offset of the text's shadow. - + The vertical offset of the text's shadow. - + Shadow outline size. If set to 1 or greater, the shadow will be displayed around the whole text as an outline. diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 45bb553c9c6..834b5a41dba 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -365,52 +365,52 @@ - + Color of the [LineEdit]'s caret (text cursor). - + Texture for the clear button. See [member clear_button_enabled]. - + Color used as default tint for the clear button. - + Color used for the clear button when it's pressed. - + Background used when [LineEdit] has GUI focus. - + Font used for the text. - + Default font color. - + The tint of text outline of the [LineEdit]. - + Font color for selected text (inside the selection rectangle). - + Font size of the [LineEdit]'s text. - + Font color when editing is disabled. - + Minimum horizontal space for the text (not counting the clear button and content margins). This value is measured in count of 'M' characters (i.e. this amount of 'M' characters can be displayed without scrolling). - + Default background for the [LineEdit]. - + The size of the text outline. - + Background used when [LineEdit] is in read-only mode ([member editable] is set to [code]false[/code]). - + Color of the selection rectangle. diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index dbf13fd842d..e4445e90760 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -66,31 +66,31 @@ - + [StyleBox] used when the [LinkButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. - + [Font] of the [LinkButton]'s text. - + Default text [Color] of the [LinkButton]. - + Text [Color] used when the [LinkButton] is being hovered. - + The tint of text outline of the [LinkButton]. - + Text [Color] used when the [LinkButton] is being pressed. - + Font size of the [LinkButton]'s text. - + The size of the text outline. - + The vertical space between the baseline of text and the underline. diff --git a/doc/classes/MarginContainer.xml b/doc/classes/MarginContainer.xml index a51632d5f15..419857c13f2 100644 --- a/doc/classes/MarginContainer.xml +++ b/doc/classes/MarginContainer.xml @@ -32,16 +32,16 @@ - + All direct children of [MarginContainer] will have a bottom margin of [code]margin_bottom[/code] pixels. - + All direct children of [MarginContainer] will have a left margin of [code]margin_left[/code] pixels. - + All direct children of [MarginContainer] will have a right margin of [code]margin_right[/code] pixels. - + All direct children of [MarginContainer] will have a top margin of [code]margin_top[/code] pixels. diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index 2d4df97895d..1c7e6f1f19c 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -44,46 +44,46 @@ - + [StyleBox] used when the [MenuButton] is disabled. - + [StyleBox] used when the [MenuButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. - + [Font] of the [MenuButton]'s text. - + Default text [Color] of the [MenuButton]. - + Text [Color] used when the [MenuButton] is disabled. - + Text [Color] used when the [MenuButton] is being hovered. - + The tint of text outline of the [MenuButton]. - + Text [Color] used when the [MenuButton] is being pressed. - + Font size of the [MenuButton]'s text. - + [StyleBox] used when the [MenuButton] is being hovered. - + The horizontal space between [MenuButton]'s icon and text. - + Default [StyleBox] for the [MenuButton]. - + The size of the text outline. - + [StyleBox] used when the [MenuButton] is being pressed. diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index ae268203ad4..8aa0ad073d7 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -186,64 +186,64 @@ - + The arrow icon to be drawn on the right end of the button. - + The horizontal space between the arrow icon and the right edge of the button. - + [StyleBox] used when the [OptionButton] is disabled (for left-to-right layouts). - + [StyleBox] used when the [OptionButton] is disabled (for right-to-left layouts). - + [StyleBox] used when the [OptionButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. - + [Font] of the [OptionButton]'s text. - + Default text [Color] of the [OptionButton]. - + Text [Color] used when the [OptionButton] is disabled. - + Text [Color] used when the [OptionButton] is being hovered. - + The tint of text outline of the [OptionButton]. - + Text [Color] used when the [OptionButton] is being pressed. - + Font size of the [OptionButton]'s text. - + [StyleBox] used when the [OptionButton] is being hovered (for left-to-right layouts). - + [StyleBox] used when the [OptionButton] is being hovered (for right-to-left layouts). - + The horizontal space between [OptionButton]'s icon and text. - + Default [StyleBox] for the [OptionButton] (for left-to-right layouts). - + Default [StyleBox] for the [OptionButton] (for right-to-left layouts). - + The size of the text outline. - + [StyleBox] used when the [OptionButton] is being pressed (for left-to-right layouts). - + [StyleBox] used when the [OptionButton] is being pressed (for right-to-left layouts). diff --git a/doc/classes/Panel.xml b/doc/classes/Panel.xml index b65c2c956de..9906abf8958 100644 --- a/doc/classes/Panel.xml +++ b/doc/classes/Panel.xml @@ -24,10 +24,10 @@ - + The style of this [Panel]. - + diff --git a/doc/classes/PanelContainer.xml b/doc/classes/PanelContainer.xml index ad6080c780b..f3f2f6839ae 100644 --- a/doc/classes/PanelContainer.xml +++ b/doc/classes/PanelContainer.xml @@ -17,7 +17,7 @@ - + The style of [PanelContainer]'s background. diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index a2c8a581cf5..61b5aa89a67 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -538,77 +538,77 @@ - + [Texture2D] icon for the checked checkbox items. - + [Font] used for the menu items. - + The text [Color] used for shortcuts and accelerators that show next to the menu item name when defined. See [method get_item_accelerator] for more info on accelerators. - + The default text [Color] for menu items' names. - + [Color] used for disabled menu items' text. - + [Color] used for the hovered text. - + The tint of text outline of the menu item. - + [Color] used for labeled separators' text. See [method add_separator]. - + Font size of the menu items. - + [StyleBox] displayed when the [PopupMenu] item is hovered. - + The horizontal space between the item's name and the shortcut text/submenu arrow. - + - + - + [StyleBox] for the left side of labeled separator. See [method add_separator]. - + [StyleBox] for the right side of labeled separator. See [method add_separator]. - + The size of the item text outline. - + Default [StyleBox] of the [PopupMenu] items. - + [StyleBox] used when the [PopupMenu] item is disabled. - + [Texture2D] icon for the checked radio button items. - + [Texture2D] icon for the unchecked radio button items. - + [StyleBox] used for the separators. See [method add_separator]. - + [Texture2D] icon for the submenu arrow (for left-to-right layouts). - + [Texture2D] icon for the submenu arrow (for right-to-left layouts). - + [Texture2D] icon for the unchecked checkbox items. - + The vertical space between each menu item. diff --git a/doc/classes/PopupPanel.xml b/doc/classes/PopupPanel.xml index 72045c5559b..56833f3f794 100644 --- a/doc/classes/PopupPanel.xml +++ b/doc/classes/PopupPanel.xml @@ -13,7 +13,7 @@ - + The background panel style of this [PopupPanel]. diff --git a/doc/classes/ProgressBar.xml b/doc/classes/ProgressBar.xml index c33f6f636dc..8bd013c86ca 100644 --- a/doc/classes/ProgressBar.xml +++ b/doc/classes/ProgressBar.xml @@ -20,28 +20,28 @@ - + The style of the background. - + The style of the progress (i.e. the part that fills the bar). - + Font used to draw the fill percentage if [member percent_visible] is [code]true[/code]. - + The color of the text. - + The tint of text outline of the [ProgressBar]. - + The color of the text's shadow. - + Font size used to draw the fill percentage if [member percent_visible] is [code]true[/code]. - + The size of the text outline. diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index e1362917b03..538e93d505f 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -522,85 +522,85 @@ - + The font used for bold text. - + The font size used for bold text. - + The font used for bold italics text. - + The font size used for bold italics text. - + The default text color. - + The background The background used when the [RichTextLabel] is focused. - + The default tint of text outline. - + The color of selected text, used when [member selection_enabled] is [code]true[/code]. - + The color of the font's shadow. - + The font used for italics text. - + The font size used for italics text. - + The vertical space between lines. - + The font used for monospace text. - + The font size used for monospace text. - + The normal background for the [RichTextLabel]. - + The default text font. - + The default text font size. - + The size of the text outline. - + The color of the selection box. - + Boolean value. If 1 ([code]true[/code]), the shadow will be displayed around the whole text as an outline. - + The horizontal offset of the font's shadow. - + The vertical offset of the font's shadow. - + The default cell border color. - + The default background color for even rows. - + The horizontal separation of elements in a table. - + The default background color for odd rows. - + The vertical separation of elements in a table. diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml index 600e2ee2458..953ab247480 100644 --- a/doc/classes/ScrollContainer.xml +++ b/doc/classes/ScrollContainer.xml @@ -72,7 +72,7 @@ - + The background [StyleBox] of the [ScrollContainer]. diff --git a/doc/classes/SpinBox.xml b/doc/classes/SpinBox.xml index 1c1e6e5a159..4303fa52f11 100644 --- a/doc/classes/SpinBox.xml +++ b/doc/classes/SpinBox.xml @@ -59,7 +59,7 @@ - + Sets a custom [Texture2D] for up and down arrows of the [SpinBox]. diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml index 2abe4dc90f4..fbda0058655 100644 --- a/doc/classes/TabContainer.xml +++ b/doc/classes/TabContainer.xml @@ -161,61 +161,61 @@ - + Icon for the left arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the first tab is visible), it appears semi-transparent. - + Icon for the left arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. - + The font used to draw tab names. - + Font color of disabled tabs. - + The tint of text outline of the tab name. - + Font color of the currently selected tab. - + Font size of the tab names. - + Font color of the other, unselected tabs. - + Space between tab's name and its icon. - + Icon for the right arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the last tab is visible) it appears semi-transparent. - + Icon for the right arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. - + The icon for the menu button (see [method set_popup]). - + The icon for the menu button (see [method set_popup]) when it's being hovered with the cursor. - + The size of the tab text outline. - + The style for the background fill. - + The space at the left and right edges of the tab bar. - + The style of disabled tabs. - + The style of the currently selected tab. - + The style of the other, unselected tabs. diff --git a/doc/classes/Tabs.xml b/doc/classes/Tabs.xml index 537bb9c4034..f4c89a8b169 100644 --- a/doc/classes/Tabs.xml +++ b/doc/classes/Tabs.xml @@ -282,58 +282,58 @@ - + Background of the close button when it's being hovered with the cursor. - + Background of the close button when it's being pressed. - + The icon for the close button (see [member tab_close_display_policy]). - + Icon for the left arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the first tab is visible), it appears semi-transparent. - + Icon for the left arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. - + The font used to draw tab names. - + Font color of disabled tabs. - + The tint of text outline of the tab name. - + Font color of the currently selected tab. - + Font size of the tab names. - + Font color of the other, unselected tabs. - + The horizontal separation between the tabs. - + Icon for the right arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the last tab is visible) it appears semi-transparent. - + Icon for the right arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. - + The size of the tab text outline. - + The style of disabled tabs. - + The style of the currently selected tab. - + The style of the other, unselected tabs. diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 5d62050a946..7b34b3c461c 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -791,57 +791,61 @@ - + Sets the background [Color] of this [TextEdit]. - + + [Color] of the text behind the caret when block caret is enabled. - + + [Color] of the caret. - - Sets the [Color] of the breakpoints. [member breakpoint_gutter] has to be enabled. + + Background [Color] of the line containing the caret. - + + Sets the [StyleBox] when in focus. - + Sets the default [Font]. - + Sets the font [Color]. - + The tint of text outline of the [TextEdit]. - + + Sets the font [Color] when [member readonly] is enabled. - + Sets the [Color] of the selected text. [member override_selected_font_color] has to be enabled. - + Sets default font size. - + Sets the spacing between the lines. - + Sets the [StyleBox] of this [TextEdit]. - + The size of the text outline. - + Sets the [StyleBox] of this [TextEdit] when [member readonly] is enabled. - + Sets the highlight [Color] of text selections. - + Sets a custom [Texture2D] for space text characters. - + Sets a custom [Texture2D] for tab text characters. - + Sets the highlight [Color] of multiple occurrences. [member highlight_all_occurrences] has to be enabled. diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index c7c2c04256f..50a573d30f3 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -474,142 +474,142 @@ - + The arrow icon used when a foldable item is not collapsed. - + The arrow icon used when a foldable item is collapsed (for left-to-right layouts). - + The arrow icon used when a foldable item is collapsed (for right-to-left layouts). - + Default [StyleBox] for the [Tree], i.e. used when the control is not being focused. - + [StyleBox] used when the [Tree] is being focused. - + The horizontal space between each button in a cell. - + [StyleBox] used when a button in the tree is pressed. - + The check icon to display when the [constant TreeItem.CELL_MODE_CHECK] mode cell is checked. - + The [Color] of the relationship lines between the selected [TreeItem] and its children. - + The width of the relationship lines between the selected [TreeItem] and its children. - + [StyleBox] used for the cursor, when the [Tree] is being focused. - + [StyleBox] used for the cursor, when the [Tree] is not being focused. - + Default [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell. - + Text [Color] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when it's hovered. - + [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when it's hovered. - + [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when it's pressed. - + Draws the guidelines if not zero, this acts as a boolean. The guideline is a horizontal line drawn at the bottom of each item. - + 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. - + [Color] used to draw possible drop locations. See [enum DropModeFlags] constants for further description of drop locations. - + [Font] of the item's text. - + Default text [Color] of the item. - + The tint of text outline of the item. - + Text [Color] used when the item is selected. - + Font size of the item's text. - + [Color] of the guideline. - + The horizontal space between item cells. This is also used as the margin at the start of an item when folding is disabled. - + The horizontal margin at the start of an item. This is used when folding is enabled for the item. - + The size of the text outline. - + The [Color] of the relationship lines between the selected [TreeItem] and its parents. - + The space between the parent relationship lines for the selected [TreeItem] and the relationship lines to its siblings that are not selected. - + The width of the relationship lines between the selected [TreeItem] and its parents. - + The default [Color] of the relationship lines. - + The default width of the relationship lines. - + The maximum distance between the mouse cursor and the control's border to trigger border scrolling when dragging. - + The speed of border scrolling. - + The arrow icon to display for the [constant TreeItem.CELL_MODE_RANGE] mode cell. - + [StyleBox] for the selected items, used when the [Tree] is not being focused. - + [StyleBox] for the selected items, used when the [Tree] is being focused. - + Default text [Color] of the title button. - + [Font] of the title button's text. - + [StyleBox] used when the title button is being hovered. - + Default [StyleBox] for the title button. - + [StyleBox] used when the title button is being pressed. - + The check icon to display when the [constant TreeItem.CELL_MODE_CHECK] mode cell is unchecked. - + The updown arrow icon to display for the [constant TreeItem.CELL_MODE_RANGE] mode cell. - + The vertical padding inside each item, i.e. the distance between the item's content and top/bottom border. diff --git a/doc/classes/VBoxContainer.xml b/doc/classes/VBoxContainer.xml index 213f8fd742b..aa6c5fc8a45 100644 --- a/doc/classes/VBoxContainer.xml +++ b/doc/classes/VBoxContainer.xml @@ -14,7 +14,7 @@ - + The vertical space between the [VBoxContainer]'s elements. diff --git a/doc/classes/VScrollBar.xml b/doc/classes/VScrollBar.xml index 727e32961cc..98a0aea0c70 100644 --- a/doc/classes/VScrollBar.xml +++ b/doc/classes/VScrollBar.xml @@ -17,31 +17,31 @@ - + Icon used as a button to scroll the [ScrollBar] up. Supports custom step using the [member ScrollBar.custom_step] property. - + Displayed when the mouse cursor hovers over the decrement button. - + Used as texture for the grabber, the draggable element representing current scroll. - + Used when the mouse hovers over the grabber. - + Used when the grabber is being dragged. - + Icon used as a button to scroll the [ScrollBar] down. Supports custom step using the [member ScrollBar.custom_step] property. - + Displayed when the mouse cursor hovers over the increment button. - + Used as background of this [ScrollBar]. - + Used as background when the [ScrollBar] has the GUI focus. diff --git a/doc/classes/VSeparator.xml b/doc/classes/VSeparator.xml index 52f31b1da73..d59c7229acb 100644 --- a/doc/classes/VSeparator.xml +++ b/doc/classes/VSeparator.xml @@ -13,10 +13,10 @@ - + The width of the area covered by the separator. Effectively works like a minimum width. - + The style for the separator line. Works best with [StyleBoxLine] (remember to enable [member StyleBoxLine.vertical]). diff --git a/doc/classes/VSlider.xml b/doc/classes/VSlider.xml index 5830c9eaf35..becf3d10524 100644 --- a/doc/classes/VSlider.xml +++ b/doc/classes/VSlider.xml @@ -18,24 +18,24 @@ - + The texture for the grabber (the draggable element). - + The background of the area below the grabber. - + - + The texture for the grabber when it's disabled. - + The texture for the grabber when it's focused. - + The background for the whole slider. Determines the width of the [code]grabber_area[/code]. - + The texture for the ticks, visible when [member Slider.tick_count] is greater than 0. diff --git a/doc/classes/VSplitContainer.xml b/doc/classes/VSplitContainer.xml index 18b515e7cec..143f5b6b0a6 100644 --- a/doc/classes/VSplitContainer.xml +++ b/doc/classes/VSplitContainer.xml @@ -13,15 +13,15 @@ - + Boolean value. If 1 ([code]true[/code]), the grabber will hide automatically when it isn't under the cursor. If 0 ([code]false[/code]), it's always visible. - + - + The icon used for the grabber drawn in the middle area. - + The space between sides of the container. diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index bc76118a56d..d7b156cc57f 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -391,33 +391,33 @@ - + - + - + - + - + - + - + - + - + - + The size of the title font. - + - + The color of the title outline. - + The size of the title outline. diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index 438b64ebbf8..770419a37c9 100755 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -90,9 +90,13 @@ class EnumDef: class ThemeItemDef: - def __init__(self, name, type_name, default_value): # type: (str, TypeName, Optional[str]) -> None + def __init__( + self, name, type_name, data_name, text, default_value + ): # type: (str, TypeName, str, Optional[str], Optional[str]) -> None self.name = name self.type_name = type_name + self.data_name = data_name + self.text = text self.default_value = default_value @@ -104,10 +108,10 @@ class ClassDef: self.properties = OrderedDict() # type: OrderedDict[str, PropertyDef] self.methods = OrderedDict() # type: OrderedDict[str, List[MethodDef]] self.signals = OrderedDict() # type: OrderedDict[str, SignalDef] + self.theme_items = OrderedDict() # type: OrderedDict[str, ThemeItemDef] self.inherits = None # type: Optional[str] self.brief_description = None # type: Optional[str] self.description = None # type: Optional[str] - self.theme_items = None # type: Optional[OrderedDict[str, List[ThemeItemDef]]] self.tutorials = [] # type: List[Tuple[str, str]] # Used to match the class with XML source for output filtering purposes. @@ -240,16 +244,33 @@ class State: theme_items = class_root.find("theme_items") if theme_items is not None: - class_def.theme_items = OrderedDict() for theme_item in theme_items: assert theme_item.tag == "theme_item" theme_item_name = theme_item.attrib["name"] + theme_item_data_name = theme_item.attrib["data_type"] + theme_item_id = "{}_{}".format(theme_item_data_name, theme_item_name) + if theme_item_id in class_def.theme_items: + print_error( + "Duplicate theme property '{}' of type '{}', file: {}".format( + theme_item_name, theme_item_data_name, class_name + ), + self, + ) + continue + default_value = theme_item.get("default") or None - theme_item_def = ThemeItemDef(theme_item_name, TypeName.from_element(theme_item), default_value) - if theme_item_name not in class_def.theme_items: - class_def.theme_items[theme_item_name] = [] - class_def.theme_items[theme_item_name].append(theme_item_def) + if default_value is not None: + default_value = "``{}``".format(default_value) + + theme_item_def = ThemeItemDef( + theme_item_name, + TypeName.from_element(theme_item), + theme_item_data_name, + theme_item.text, + default_value, + ) + class_def.theme_items[theme_item_id] = theme_item_def tutorials = class_root.find("tutorials") if tutorials is not None: @@ -461,9 +482,11 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S if class_def.theme_items is not None and len(class_def.theme_items) > 0: f.write(make_heading("Theme Properties", "-")) pl = [] - for theme_item_list in class_def.theme_items.values(): - for theme_item in theme_item_list: - pl.append((theme_item.type_name.to_rst(state), theme_item.name, theme_item.default_value)) + for theme_item_def in class_def.theme_items.values(): + ref = ":ref:`{0}`".format( + theme_item_def.name, theme_item_def.data_name, class_name + ) + pl.append((theme_item_def.type_name.to_rst(state), ref, theme_item_def.default_value)) format_table(f, pl, True) # Signals @@ -578,6 +601,29 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S index += 1 + if len(class_def.theme_items) > 0: + f.write(make_heading("Theme Property Descriptions", "-")) + index = 0 + + for theme_item_def in class_def.theme_items.values(): + if index != 0: + f.write("----\n\n") + + f.write(".. _class_{}_theme_{}_{}:\n\n".format(class_name, theme_item_def.data_name, theme_item_def.name)) + f.write("- {} **{}**\n\n".format(theme_item_def.type_name.to_rst(state), theme_item_def.name)) + + info = [] + if theme_item_def.default_value is not None: + info.append(("*Default*", theme_item_def.default_value)) + + if len(info) > 0: + format_table(f, info) + + if theme_item_def.text is not None and theme_item_def.text.strip() != "": + f.write(rstize_text(theme_item_def.text.strip(), state) + "\n\n") + + index += 1 + f.write(make_footer()) diff --git a/editor/doc_tools.cpp b/editor/doc_tools.cpp index c752d0d4fd6..56a9d2c2581 100644 --- a/editor/doc_tools.cpp +++ b/editor/doc_tools.cpp @@ -145,15 +145,15 @@ void DocTools::merge_from(const DocTools &p_data) { } for (int i = 0; i < c.theme_properties.size(); i++) { - DocData::PropertyDoc &p = c.theme_properties.write[i]; + DocData::ThemeItemDoc &ti = c.theme_properties.write[i]; for (int j = 0; j < cf.theme_properties.size(); j++) { - if (cf.theme_properties[j].name != p.name) { + if (cf.theme_properties[j].name != ti.name || cf.theme_properties[j].data_type != ti.data_type) { continue; } - const DocData::PropertyDoc &pf = cf.theme_properties[j]; + const DocData::ThemeItemDoc &pf = cf.theme_properties[j]; - p.description = pf.description; + ti.description = pf.description; break; } } @@ -464,60 +464,69 @@ void DocTools::generate(bool p_basic_types) { c.constants.push_back(constant); } - //theme stuff - + // Theme items. { List l; - Theme::get_default()->get_constant_list(cname, &l); + + Theme::get_default()->get_color_list(cname, &l); for (const StringName &E : l) { - DocData::PropertyDoc pd; - pd.name = E; - pd.type = "int"; - pd.default_value = itos(Theme::get_default()->get_constant(E, cname)); - c.theme_properties.push_back(pd); + DocData::ThemeItemDoc tid; + tid.name = E; + tid.type = "Color"; + tid.data_type = "color"; + tid.default_value = Variant(Theme::get_default()->get_color(E, cname)).get_construct_string(); + c.theme_properties.push_back(tid); } l.clear(); - Theme::get_default()->get_color_list(cname, &l); + Theme::get_default()->get_constant_list(cname, &l); for (const StringName &E : l) { - DocData::PropertyDoc pd; - pd.name = E; - pd.type = "Color"; - pd.default_value = Variant(Theme::get_default()->get_color(E, cname)).get_construct_string(); - c.theme_properties.push_back(pd); + DocData::ThemeItemDoc tid; + tid.name = E; + tid.type = "int"; + tid.data_type = "constant"; + tid.default_value = itos(Theme::get_default()->get_constant(E, cname)); + c.theme_properties.push_back(tid); + } + + l.clear(); + Theme::get_default()->get_font_list(cname, &l); + for (const StringName &E : l) { + DocData::ThemeItemDoc tid; + tid.name = E; + tid.type = "Font"; + tid.data_type = "font"; + c.theme_properties.push_back(tid); + } + + l.clear(); + Theme::get_default()->get_font_size_list(cname, &l); + for (const StringName &E : l) { + DocData::ThemeItemDoc tid; + tid.name = E; + tid.type = "int"; + tid.data_type = "font_size"; + c.theme_properties.push_back(tid); } l.clear(); Theme::get_default()->get_icon_list(cname, &l); for (const StringName &E : l) { - DocData::PropertyDoc pd; - pd.name = E; - pd.type = "Texture2D"; - c.theme_properties.push_back(pd); - } - l.clear(); - Theme::get_default()->get_font_list(cname, &l); - for (const StringName &E : l) { - DocData::PropertyDoc pd; - pd.name = E; - pd.type = "Font"; - c.theme_properties.push_back(pd); - } - l.clear(); - Theme::get_default()->get_font_size_list(cname, &l); - for (const StringName &E : l) { - DocData::PropertyDoc pd; - pd.name = E; - pd.type = "int"; - c.theme_properties.push_back(pd); + DocData::ThemeItemDoc tid; + tid.name = E; + tid.type = "Texture2D"; + tid.data_type = "icon"; + c.theme_properties.push_back(tid); } + l.clear(); Theme::get_default()->get_stylebox_list(cname, &l); for (const StringName &E : l) { - DocData::PropertyDoc pd; - pd.name = E; - pd.type = "StyleBox"; - c.theme_properties.push_back(pd); + DocData::ThemeItemDoc tid; + tid.name = E; + tid.type = "StyleBox"; + tid.data_type = "style"; + c.theme_properties.push_back(tid); } } @@ -1069,12 +1078,14 @@ Error DocTools::_load(Ref parser) { String name3 = parser->get_node_name(); if (name3 == "theme_item") { - DocData::PropertyDoc prop2; + DocData::ThemeItemDoc prop2; ERR_FAIL_COND_V(!parser->has_attribute("name"), ERR_FILE_CORRUPT); prop2.name = parser->get_attribute_value("name"); ERR_FAIL_COND_V(!parser->has_attribute("type"), ERR_FILE_CORRUPT); prop2.type = parser->get_attribute_value("type"); + ERR_FAIL_COND_V(!parser->has_attribute("data_type"), ERR_FILE_CORRUPT); + prop2.data_type = parser->get_attribute_value("data_type"); if (!parser->is_empty()) { parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) { @@ -1312,15 +1323,15 @@ Error DocTools::save_classes(const String &p_default_path, const Map"); for (int i = 0; i < c.theme_properties.size(); i++) { - const DocData::PropertyDoc &p = c.theme_properties[i]; + const DocData::ThemeItemDoc &ti = c.theme_properties[i]; - if (p.default_value != "") { - _write_string(f, 2, ""); + if (ti.default_value != "") { + _write_string(f, 2, ""); } else { - _write_string(f, 2, ""); + _write_string(f, 2, ""); } - _write_string(f, 3, p.description.strip_edges().xml_escape()); + _write_string(f, 3, ti.description.strip_edges().xml_escape()); _write_string(f, 2, ""); } diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 569a28215ce..f92b9ac8ba4 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -758,8 +758,8 @@ void EditorHelp::_update_doc() { if (cd.theme_properties[i].description != "") { class_desc->push_font(doc_font); - class_desc->add_text(" "); class_desc->push_color(comment_color); + class_desc->add_text(U" – "); _add_text(DTR(cd.theme_properties[i].description)); class_desc->pop(); class_desc->pop(); @@ -941,8 +941,7 @@ void EditorHelp::_update_doc() { if (enum_list[i].description != "") { class_desc->push_font(doc_font); class_desc->push_color(comment_color); - static const char32_t dash[6] = { ' ', ' ', 0x2013 /* en dash */, ' ', ' ', 0 }; - class_desc->add_text(String(dash)); + class_desc->add_text(U" – "); _add_text(DTR(enum_list[i].description)); class_desc->pop(); class_desc->pop(); @@ -1011,8 +1010,7 @@ void EditorHelp::_update_doc() { if (constants[i].description != "") { class_desc->push_font(doc_font); class_desc->push_color(comment_color); - static const char32_t dash[6] = { ' ', ' ', 0x2013 /* en dash */, ' ', ' ', 0 }; - class_desc->add_text(String(dash)); + class_desc->add_text(U" – "); _add_text(DTR(constants[i].description)); class_desc->pop(); class_desc->pop(); diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index fabbf97f49c..57f0345dada 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -367,7 +367,7 @@ bool EditorHelpSearch::Runner::_phase_match_classes() { if (search_flags & SEARCH_THEME_ITEMS) { for (int i = 0; i < class_doc.theme_properties.size(); i++) { if (_match_string(term, class_doc.theme_properties[i].name)) { - match.theme_properties.push_back(const_cast(&class_doc.theme_properties[i])); + match.theme_properties.push_back(const_cast(&class_doc.theme_properties[i])); } } } @@ -571,7 +571,7 @@ TreeItem *EditorHelpSearch::Runner::_create_property_item(TreeItem *p_parent, co return _create_member_item(p_parent, p_class_doc->name, "MemberProperty", p_doc->name, p_doc->name, TTRC("Property"), "property", tooltip); } -TreeItem *EditorHelpSearch::Runner::_create_theme_property_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const DocData::PropertyDoc *p_doc) { +TreeItem *EditorHelpSearch::Runner::_create_theme_property_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const DocData::ThemeItemDoc *p_doc) { String tooltip = p_doc->type + " " + p_class_doc->name + "." + p_doc->name; return _create_member_item(p_parent, p_class_doc->name, "MemberTheme", p_doc->name, p_doc->name, TTRC("Theme Property"), "theme_item", tooltip); } diff --git a/editor/editor_help_search.h b/editor/editor_help_search.h index 75da2d5aba1..bc57c0e3c6a 100644 --- a/editor/editor_help_search.h +++ b/editor/editor_help_search.h @@ -103,7 +103,7 @@ class EditorHelpSearch::Runner : public RefCounted { Vector signals; Vector constants; Vector properties; - Vector theme_properties; + Vector theme_properties; bool required() { return name || methods.size() || signals.size() || constants.size() || properties.size() || theme_properties.size(); @@ -145,7 +145,7 @@ class EditorHelpSearch::Runner : public RefCounted { TreeItem *_create_signal_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const DocData::MethodDoc *p_doc); TreeItem *_create_constant_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const DocData::ConstantDoc *p_doc); TreeItem *_create_property_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const DocData::PropertyDoc *p_doc); - TreeItem *_create_theme_property_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const DocData::PropertyDoc *p_doc); + TreeItem *_create_theme_property_item(TreeItem *p_parent, const DocData::ClassDoc *p_class_doc, const DocData::ThemeItemDoc *p_doc); TreeItem *_create_member_item(TreeItem *p_parent, const String &p_class_name, const String &p_icon, const String &p_name, const String &p_text, const String &p_type, const String &p_metatype, const String &p_tooltip); public: diff --git a/modules/gdscript/language_server/gdscript_workspace.cpp b/modules/gdscript/language_server/gdscript_workspace.cpp index e6c819b22f3..5a000f1e903 100644 --- a/modules/gdscript/language_server/gdscript_workspace.cpp +++ b/modules/gdscript/language_server/gdscript_workspace.cpp @@ -231,18 +231,13 @@ Error GDScriptWorkspace::initialize() { class_symbol.children.push_back(symbol); } - Vector properties; - properties.append_array(class_data.properties); - const int theme_prop_start_idx = properties.size(); - properties.append_array(class_data.theme_properties); - for (int i = 0; i < class_data.properties.size(); i++) { const DocData::PropertyDoc &data = class_data.properties[i]; lsp::DocumentSymbol symbol; symbol.name = data.name; symbol.native_class = class_name; symbol.kind = lsp::SymbolKind::Property; - symbol.detail = String(i >= theme_prop_start_idx ? " var" : "var") + " " + class_name + "." + data.name; + symbol.detail = "var " + class_name + "." + data.name; if (data.enumeration.length()) { symbol.detail += ": " + data.enumeration; } else { @@ -252,6 +247,17 @@ Error GDScriptWorkspace::initialize() { class_symbol.children.push_back(symbol); } + for (int i = 0; i < class_data.theme_properties.size(); i++) { + const DocData::ThemeItemDoc &data = class_data.theme_properties[i]; + lsp::DocumentSymbol symbol; + symbol.name = data.name; + symbol.native_class = class_name; + symbol.kind = lsp::SymbolKind::Property; + symbol.detail = " var " + class_name + "." + data.name + ": " + data.type; + symbol.documentation = data.description; + class_symbol.children.push_back(symbol); + } + Vector methods_signals; methods_signals.append_array(class_data.methods); const int signal_start_idx = methods_signals.size();