Skip to content

Commit

Permalink
Use bound theme properties for documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
YuriSizov committed Sep 26, 2023
1 parent 36945da commit 03a2472
Show file tree
Hide file tree
Showing 35 changed files with 189 additions and 567 deletions.
14 changes: 14 additions & 0 deletions doc/classes/Button.xml
Expand Up @@ -131,20 +131,34 @@
<theme_item name="font_size" data_type="font_size" type="int">
Font size of the [Button]'s text.
</theme_item>
<theme_item name="icon" data_type="icon" type="Texture2D">
</theme_item>
<theme_item name="disabled" data_type="style" type="StyleBox">
[StyleBox] used when the [Button] is disabled.
</theme_item>
<theme_item name="disabled_mirrored" data_type="style" type="StyleBox">
</theme_item>
<theme_item name="focus" data_type="style" type="StyleBox">
[StyleBox] used when the [Button] is focused. The [code]focus[/code] [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="hover" data_type="style" type="StyleBox">
[StyleBox] used when the [Button] is being hovered.
</theme_item>
<theme_item name="hover_mirrored" data_type="style" type="StyleBox">
</theme_item>
<theme_item name="hover_pressed" data_type="style" type="StyleBox">
</theme_item>
<theme_item name="hover_pressed_mirrored" data_type="style" type="StyleBox">
</theme_item>
<theme_item name="normal" data_type="style" type="StyleBox">
Default [StyleBox] for the [Button].
</theme_item>
<theme_item name="normal_mirrored" data_type="style" type="StyleBox">
</theme_item>
<theme_item name="pressed" data_type="style" type="StyleBox">
[StyleBox] used when the [Button] is being pressed.
</theme_item>
<theme_item name="pressed_mirrored" data_type="style" type="StyleBox">
</theme_item>
</theme_items>
</class>
46 changes: 0 additions & 46 deletions doc/classes/CheckBox.xml
Expand Up @@ -15,43 +15,12 @@
<member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode" overrides="BaseButton" default="true" />
</members>
<theme_items>
<theme_item name="font_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)">
The [CheckBox] text's font color.
</theme_item>
<theme_item name="font_disabled_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 0.5)">
The [CheckBox] text's font color when it's disabled.
</theme_item>
<theme_item name="font_focus_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)">
The [CheckBox] text's font color when it's focused. Only replaces the normal text color of the checkbox. Disabled, hovered, and pressed states take precedence over this color.
</theme_item>
<theme_item name="font_hover_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)">
The [CheckBox] text's font color when it's hovered.
</theme_item>
<theme_item name="font_hover_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
The [CheckBox] text's font color when it's hovered and pressed.
</theme_item>
<theme_item name="font_outline_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
The tint of text outline of the [CheckBox].
</theme_item>
<theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
The [CheckBox] text's font color when it's pressed.
</theme_item>
<theme_item name="check_v_offset" data_type="constant" type="int" default="0">
The vertical offset used when rendering the check icons (in pixels).
</theme_item>
<theme_item name="h_separation" data_type="constant" type="int" default="4">
The separation between the check icon and the text (in pixels). Negative values will be treated as [code]0[/code] when used.
</theme_item>
<theme_item name="outline_size" data_type="constant" type="int" default="0">
The size of the text outline.
[b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
</theme_item>
<theme_item name="font" data_type="font" type="Font">
The [Font] to use for the [CheckBox] text.
</theme_item>
<theme_item name="font_size" data_type="font_size" type="int">
Font size of the [CheckBox]'s text.
</theme_item>
<theme_item name="checked" data_type="icon" type="Texture2D">
The check icon to display when the [CheckBox] is checked.
</theme_item>
Expand All @@ -76,23 +45,8 @@
<theme_item name="unchecked_disabled" data_type="icon" type="Texture2D">
The check icon to display when the [CheckBox] is unchecked and is disabled.
</theme_item>
<theme_item name="disabled" data_type="style" type="StyleBox">
The [StyleBox] to display as a background when the [CheckBox] is disabled.
</theme_item>
<theme_item name="focus" data_type="style" type="StyleBox">
The [StyleBox] to display as a background when the [CheckBox] is focused. The [code]focus[/code] [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="hover" data_type="style" type="StyleBox">
The [StyleBox] to display as a background when the [CheckBox] is hovered.
</theme_item>
<theme_item name="hover_pressed" data_type="style" type="StyleBox">
The [StyleBox] to display as a background when the [CheckBox] is hovered and pressed.
</theme_item>
<theme_item name="normal" data_type="style" type="StyleBox">
The [StyleBox] to display as a background.
</theme_item>
<theme_item name="pressed" data_type="style" type="StyleBox">
The [StyleBox] to display as a background when the [CheckBox] is pressed.
</theme_item>
</theme_items>
</class>
46 changes: 0 additions & 46 deletions doc/classes/CheckButton.xml
Expand Up @@ -14,43 +14,12 @@
<member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode" overrides="BaseButton" default="true" />
</members>
<theme_items>
<theme_item name="font_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)">
The [CheckButton] text's font color.
</theme_item>
<theme_item name="font_disabled_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 0.5)">
The [CheckButton] text's font color when it's disabled.
</theme_item>
<theme_item name="font_focus_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)">
The [CheckButton] text's font color when it's focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color.
</theme_item>
<theme_item name="font_hover_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)">
The [CheckButton] text's font color when it's hovered.
</theme_item>
<theme_item name="font_hover_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
The [CheckButton] text's font color when it's hovered and pressed.
</theme_item>
<theme_item name="font_outline_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
The tint of text outline of the [CheckButton].
</theme_item>
<theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
The [CheckButton] text's font color when it's pressed.
</theme_item>
<theme_item name="check_v_offset" data_type="constant" type="int" default="0">
The vertical offset used when rendering the toggle icons (in pixels).
</theme_item>
<theme_item name="h_separation" data_type="constant" type="int" default="4">
The separation between the toggle icon and the text (in pixels). Negative values will be treated as [code]0[/code] when used.
</theme_item>
<theme_item name="outline_size" data_type="constant" type="int" default="0">
The size of the text outline.
[b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
</theme_item>
<theme_item name="font" data_type="font" type="Font">
The [Font] to use for the [CheckButton] text.
</theme_item>
<theme_item name="font_size" data_type="font_size" type="int">
Font size of the [CheckButton]'s text.
</theme_item>
<theme_item name="checked" data_type="icon" type="Texture2D">
The icon to display when the [CheckButton] is checked (for left-to-right layouts).
</theme_item>
Expand All @@ -75,23 +44,8 @@
<theme_item name="unchecked_mirrored" data_type="icon" type="Texture2D">
The icon to display when the [CheckButton] is unchecked (for right-to-left layouts).
</theme_item>
<theme_item name="disabled" data_type="style" type="StyleBox">
The [StyleBox] to display as a background when the [CheckButton] is disabled.
</theme_item>
<theme_item name="focus" data_type="style" type="StyleBox">
The [StyleBox] to display as a background when the [CheckButton] is focused. The [code]focus[/code] [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="hover" data_type="style" type="StyleBox">
The [StyleBox] to display as a background when the [CheckButton] is hovered.
</theme_item>
<theme_item name="hover_pressed" data_type="style" type="StyleBox">
The [StyleBox] to display as a background when the [CheckButton] is hovered and pressed.
</theme_item>
<theme_item name="normal" data_type="style" type="StyleBox">
The [StyleBox] to display as a background.
</theme_item>
<theme_item name="pressed" data_type="style" type="StyleBox">
The [StyleBox] to display as a background when the [CheckButton] is pressed.
</theme_item>
</theme_items>
</class>
58 changes: 0 additions & 58 deletions doc/classes/CodeEdit.xml
Expand Up @@ -633,9 +633,6 @@
</constant>
</constants>
<theme_items>
<theme_item name="background_color" data_type="color" type="Color" default="Color(0, 0, 0, 0)">
Sets the background [Color].
</theme_item>
<theme_item name="bookmark_color" data_type="color" type="Color" default="Color(0.5, 0.64, 1, 0.8)">
[Color] of the bookmark icon for bookmarked lines.
</theme_item>
Expand All @@ -645,12 +642,6 @@
<theme_item name="breakpoint_color" data_type="color" type="Color" default="Color(0.9, 0.29, 0.3, 1)">
[Color] of the breakpoint icon for bookmarked lines.
</theme_item>
<theme_item name="caret_background_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)">
[Color] of the text behind the caret when block caret is enabled.
</theme_item>
<theme_item name="caret_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)">
[Color] of the caret.
</theme_item>
<theme_item name="code_folding_color" data_type="color" type="Color" default="Color(0.8, 0.8, 0.8, 0.8)">
[Color] for all icons related to line folding.
</theme_item>
Expand All @@ -660,9 +651,6 @@
<theme_item name="completion_existing_color" data_type="color" type="Color" default="Color(0.87, 0.87, 0.87, 0.13)">
Background highlight [Color] for matching text in code completion options.
</theme_item>
<theme_item name="completion_font_color" data_type="color" type="Color" default="Color(0.67, 0.67, 0.67, 1)">
Font [Color] for the code completion popup.
</theme_item>
<theme_item name="completion_scroll_color" data_type="color" type="Color" default="Color(1, 1, 1, 0.29)">
[Color] of the scrollbar in the code completion popup.
</theme_item>
Expand All @@ -672,48 +660,18 @@
<theme_item name="completion_selected_color" data_type="color" type="Color" default="Color(0.26, 0.26, 0.27, 1)">
Background highlight [Color] for the current selected option item in the code completion popup.
</theme_item>
<theme_item name="current_line_color" data_type="color" type="Color" default="Color(0.25, 0.25, 0.26, 0.8)">
Background [Color] of the line containing the caret.
</theme_item>
<theme_item name="executing_line_color" data_type="color" type="Color" default="Color(0.98, 0.89, 0.27, 1)">
[Color] of the executing icon for executing lines.
</theme_item>
<theme_item name="folded_code_region_color" data_type="color" type="Color" default="Color(0.68, 0.46, 0.77, 0.2)">
[Color] of background line highlight for folded code region.
</theme_item>
<theme_item name="font_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)">
Sets the font [Color].
</theme_item>
<theme_item name="font_outline_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
The tint of text outline of the [CodeEdit].
</theme_item>
<theme_item name="font_placeholder_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 0.6)">
Font color for [member TextEdit.placeholder_text].
</theme_item>
<theme_item name="font_readonly_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 0.5)">
Sets the font [Color] when [member TextEdit.editable] is disabled.
</theme_item>
<theme_item name="font_selected_color" data_type="color" type="Color" default="Color(0, 0, 0, 0)">
Sets the [Color] of the selected text. If equal to [code]Color(0, 0, 0, 0)[/code], it will be ignored.
</theme_item>
<theme_item name="line_length_guideline_color" data_type="color" type="Color" default="Color(0.3, 0.5, 0.8, 0.1)">
[Color] of the main line length guideline, secondary guidelines will have 50% alpha applied.
</theme_item>
<theme_item name="line_number_color" data_type="color" type="Color" default="Color(0.67, 0.67, 0.67, 0.4)">
Sets the [Color] of line numbers.
</theme_item>
<theme_item name="search_result_border_color" data_type="color" type="Color" default="Color(0.3, 0.3, 0.3, 0.4)">
[Color] of the border around text that matches the search query.
</theme_item>
<theme_item name="search_result_color" data_type="color" type="Color" default="Color(0.3, 0.3, 0.3, 1)">
[Color] behind the text that matches the search query.
</theme_item>
<theme_item name="selection_color" data_type="color" type="Color" default="Color(0.5, 0.5, 0.5, 1)">
Sets the highlight [Color] of text selections.
</theme_item>
<theme_item name="word_highlighted_color" data_type="color" type="Color" default="Color(0.8, 0.9, 0.9, 0.15)">
Sets the highlight [Color] of multiple occurrences. [member TextEdit.highlight_all_occurrences] has to be enabled.
</theme_item>
<theme_item name="completion_lines" data_type="constant" type="int" default="7">
Max number of options to display in the code completion popup at any one time.
</theme_item>
Expand All @@ -726,10 +684,6 @@
<theme_item name="line_spacing" data_type="constant" type="int" default="4">
Sets the spacing between the lines.
</theme_item>
<theme_item name="outline_size" data_type="constant" type="int" default="0">
The size of the text outline.
[b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
</theme_item>
<theme_item name="font" data_type="font" type="Font">
Sets the default [Font].
</theme_item>
Expand Down Expand Up @@ -760,23 +714,11 @@
<theme_item name="folded_eol_icon" data_type="icon" type="Texture2D">
Sets a custom [Texture2D] to draw at the end of a folded line.
</theme_item>
<theme_item name="space" data_type="icon" type="Texture2D">
Sets a custom [Texture2D] for space text characters.
</theme_item>
<theme_item name="tab" data_type="icon" type="Texture2D">
Sets a custom [Texture2D] for tab text characters.
</theme_item>
<theme_item name="completion" data_type="style" type="StyleBox">
[StyleBox] for the code completion popup.
</theme_item>
<theme_item name="focus" data_type="style" type="StyleBox">
Sets the [StyleBox] when in focus. The [code]focus[/code] [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="normal" data_type="style" type="StyleBox">
Sets the [StyleBox].
</theme_item>
<theme_item name="read_only" data_type="style" type="StyleBox">
Sets the [StyleBox] when [member TextEdit.editable] is disabled.
</theme_item>
</theme_items>
</class>
2 changes: 1 addition & 1 deletion doc/classes/ColorPicker.xml
Expand Up @@ -142,7 +142,7 @@
</constants>
<theme_items>
<theme_item name="center_slider_grabbers" data_type="constant" type="int" default="1">
Overrides the [theme_item HSlider.center_grabber] theme property of the sliders.
Overrides the [theme_item Slider.center_grabber] theme property of the sliders.
</theme_item>
<theme_item name="h_width" data_type="constant" type="int" default="30">
The width of the hue selection slider.
Expand Down

0 comments on commit 03a2472

Please sign in to comment.