Merge pull request #64895 from Calinou/editor-help-add-kbd-tag-3.x
This commit is contained in:
commit
0b4e600f2b
13 changed files with 59 additions and 37 deletions
|
@ -155,7 +155,7 @@
|
||||||
Tab key.
|
Tab key.
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="KEY_BACKTAB" value="16777219" enum="KeyList">
|
<constant name="KEY_BACKTAB" value="16777219" enum="KeyList">
|
||||||
Shift+Tab key.
|
Shift + Tab key.
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="KEY_BACKSPACE" value="16777220" enum="KeyList">
|
<constant name="KEY_BACKSPACE" value="16777220" enum="KeyList">
|
||||||
Backspace key.
|
Backspace key.
|
||||||
|
|
|
@ -772,11 +772,11 @@
|
||||||
Tells Godot which node it should give keyboard focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the [code]ui_top[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one.
|
Tells Godot which node it should give keyboard focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the [code]ui_top[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one.
|
||||||
</member>
|
</member>
|
||||||
<member name="focus_next" type="NodePath" setter="set_focus_next" getter="get_focus_next" default="NodePath("")">
|
<member name="focus_next" type="NodePath" setter="set_focus_next" getter="get_focus_next" default="NodePath("")">
|
||||||
Tells Godot which node it should give keyboard focus to if the user presses Tab on a keyboard by default. You can change the key by editing the [code]ui_focus_next[/code] input action.
|
Tells Godot which node it should give keyboard focus to if the user presses [kbd]Tab[/kbd] on a keyboard by default. You can change the key by editing the [code]ui_focus_next[/code] input action.
|
||||||
If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.
|
If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.
|
||||||
</member>
|
</member>
|
||||||
<member name="focus_previous" type="NodePath" setter="set_focus_previous" getter="get_focus_previous" default="NodePath("")">
|
<member name="focus_previous" type="NodePath" setter="set_focus_previous" getter="get_focus_previous" default="NodePath("")">
|
||||||
Tells Godot which node it should give keyboard focus to if the user presses Shift+Tab on a keyboard by default. You can change the key by editing the [code]ui_focus_prev[/code] input action.
|
Tells Godot which node it should give keyboard focus to if the user presses [kbd]Shift + Tab[/kbd] on a keyboard by default. You can change the key by editing the [code]ui_focus_prev[/code] input action.
|
||||||
If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.
|
If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.
|
||||||
</member>
|
</member>
|
||||||
<member name="grow_horizontal" type="int" setter="set_h_grow_direction" getter="get_h_grow_direction" enum="Control.GrowDirection" default="1">
|
<member name="grow_horizontal" type="int" setter="set_h_grow_direction" getter="get_h_grow_direction" enum="Control.GrowDirection" default="1">
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
Base script that can be used to add extension functions to the editor.
|
Base script that can be used to add extension functions to the editor.
|
||||||
</brief_description>
|
</brief_description>
|
||||||
<description>
|
<description>
|
||||||
Scripts extending this class and implementing its [method _run] method can be executed from the Script Editor's [b]File > Run[/b] menu option (or by pressing [code]Ctrl+Shift+X[/code]) while the editor is running. This is useful for adding custom in-editor functionality to Godot. For more complex additions, consider using [EditorPlugin]s instead.
|
Scripts extending this class and implementing its [method _run] method can be executed from the Script Editor's [b]File > Run[/b] menu option (or by pressing [kbd]Ctrl + Shift + X[/kbd]) while the editor is running. This is useful for adding custom in-editor functionality to Godot. For more complex additions, consider using [EditorPlugin]s instead.
|
||||||
[b]Note:[/b] Extending scripts need to have [code]tool[/code] mode enabled.
|
[b]Note:[/b] Extending scripts need to have [code]tool[/code] mode enabled.
|
||||||
[b]Example script:[/b]
|
[b]Example script:[/b]
|
||||||
[codeblock]
|
[codeblock]
|
||||||
|
|
|
@ -208,7 +208,7 @@
|
||||||
</signal>
|
</signal>
|
||||||
<signal name="copy_nodes_request">
|
<signal name="copy_nodes_request">
|
||||||
<description>
|
<description>
|
||||||
Emitted when the user presses [code]Ctrl + C[/code].
|
Emitted when the user presses [kbd]Ctrl + C[/kbd].
|
||||||
</description>
|
</description>
|
||||||
</signal>
|
</signal>
|
||||||
<signal name="delete_nodes_request">
|
<signal name="delete_nodes_request">
|
||||||
|
@ -244,7 +244,7 @@
|
||||||
</signal>
|
</signal>
|
||||||
<signal name="paste_nodes_request">
|
<signal name="paste_nodes_request">
|
||||||
<description>
|
<description>
|
||||||
Emitted when the user presses [code]Ctrl + V[/code].
|
Emitted when the user presses [kbd]Ctrl + V[/kbd].
|
||||||
</description>
|
</description>
|
||||||
</signal>
|
</signal>
|
||||||
<signal name="popup_request">
|
<signal name="popup_request">
|
||||||
|
|
|
@ -13,14 +13,14 @@
|
||||||
<method name="get_physical_scancode_with_modifiers" qualifiers="const">
|
<method name="get_physical_scancode_with_modifiers" qualifiers="const">
|
||||||
<return type="int" />
|
<return type="int" />
|
||||||
<description>
|
<description>
|
||||||
Returns the physical scancode combined with modifier keys such as [code]Shift[/code] or [code]Alt[/code]. See also [InputEventWithModifiers].
|
Returns the physical scancode combined with modifier keys such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See also [InputEventWithModifiers].
|
||||||
To get a human-readable representation of the [InputEventKey] with modifiers, use [code]OS.get_scancode_string(event.get_physical_scancode_with_modifiers())[/code] where [code]event[/code] is the [InputEventKey].
|
To get a human-readable representation of the [InputEventKey] with modifiers, use [code]OS.get_scancode_string(event.get_physical_scancode_with_modifiers())[/code] where [code]event[/code] is the [InputEventKey].
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="get_scancode_with_modifiers" qualifiers="const">
|
<method name="get_scancode_with_modifiers" qualifiers="const">
|
||||||
<return type="int" />
|
<return type="int" />
|
||||||
<description>
|
<description>
|
||||||
Returns the scancode combined with modifier keys such as [code]Shift[/code] or [code]Alt[/code]. See also [InputEventWithModifiers].
|
Returns the scancode combined with modifier keys such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See also [InputEventWithModifiers].
|
||||||
To get a human-readable representation of the [InputEventKey] with modifiers, use [code]OS.get_scancode_string(event.get_scancode_with_modifiers())[/code] where [code]event[/code] is the [InputEventKey].
|
To get a human-readable representation of the [InputEventKey] with modifiers, use [code]OS.get_scancode_string(event.get_scancode_with_modifiers())[/code] where [code]event[/code] is the [InputEventKey].
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
Base class for keys events with modifiers.
|
Base class for keys events with modifiers.
|
||||||
</brief_description>
|
</brief_description>
|
||||||
<description>
|
<description>
|
||||||
Contains keys events information with modifiers support like [code]Shift[/code] or [code]Alt[/code]. See [method Node._input].
|
Contains keys events information with modifiers support like [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See [method Node._input].
|
||||||
</description>
|
</description>
|
||||||
<tutorials>
|
<tutorials>
|
||||||
<link>$DOCS_URL/tutorials/inputs/inputevent.html</link>
|
<link>$DOCS_URL/tutorials/inputs/inputevent.html</link>
|
||||||
|
@ -13,19 +13,19 @@
|
||||||
</methods>
|
</methods>
|
||||||
<members>
|
<members>
|
||||||
<member name="alt" type="bool" setter="set_alt" getter="get_alt" default="false">
|
<member name="alt" type="bool" setter="set_alt" getter="get_alt" default="false">
|
||||||
State of the [code]Alt[/code] modifier.
|
State of the [kbd]Alt[/kbd] modifier.
|
||||||
</member>
|
</member>
|
||||||
<member name="command" type="bool" setter="set_command" getter="get_command" default="false">
|
<member name="command" type="bool" setter="set_command" getter="get_command" default="false">
|
||||||
State of the [code]Command[/code] modifier.
|
State of the [kbd]Command[/kbd] modifier.
|
||||||
</member>
|
</member>
|
||||||
<member name="control" type="bool" setter="set_control" getter="get_control" default="false">
|
<member name="control" type="bool" setter="set_control" getter="get_control" default="false">
|
||||||
State of the [code]Ctrl[/code] modifier.
|
State of the [kbd]Ctrl[/kbd] modifier.
|
||||||
</member>
|
</member>
|
||||||
<member name="meta" type="bool" setter="set_metakey" getter="get_metakey" default="false">
|
<member name="meta" type="bool" setter="set_metakey" getter="get_metakey" default="false">
|
||||||
State of the [code]Meta[/code] modifier.
|
State of the [kbd]Meta[/kbd] modifier.
|
||||||
</member>
|
</member>
|
||||||
<member name="shift" type="bool" setter="set_shift" getter="get_shift" default="false">
|
<member name="shift" type="bool" setter="set_shift" getter="get_shift" default="false">
|
||||||
State of the [code]Shift[/code] modifier.
|
State of the [kbd]Shift[/kbd] modifier.
|
||||||
</member>
|
</member>
|
||||||
</members>
|
</members>
|
||||||
<constants>
|
<constants>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
</brief_description>
|
</brief_description>
|
||||||
<description>
|
<description>
|
||||||
This control provides a selectable list of items that may be in a single (or multiple columns) with option of text, icons, or both text and icon. Tooltips are supported and may be different for every item in the list.
|
This control provides a selectable list of items that may be in a single (or multiple columns) with option of text, icons, or both text and icon. Tooltips are supported and may be different for every item in the list.
|
||||||
Selectable items in the list may be selected or deselected and multiple selection may be enabled. Selection with right mouse button may also be enabled to allow use of popup context menus. Items may also be "activated" by double-clicking them or by pressing Enter.
|
Selectable items in the list may be selected or deselected and multiple selection may be enabled. Selection with right mouse button may also be enabled to allow use of popup context menus. Items may also be "activated" by double-clicking them or by pressing [kbd]Enter[/kbd].
|
||||||
Item text only supports single-line strings, newline characters (e.g. [code]\n[/code]) in the string won't produce a newline. Text wrapping is enabled in [constant ICON_MODE_TOP] mode, but column's width is adjusted to fully fit its content by default. You need to set [member fixed_column_width] greater than zero to wrap the text.
|
Item text only supports single-line strings, newline characters (e.g. [code]\n[/code]) in the string won't produce a newline. Text wrapping is enabled in [constant ICON_MODE_TOP] mode, but column's width is adjusted to fully fit its content by default. You need to set [member fixed_column_width] greater than zero to wrap the text.
|
||||||
[b]Incremental search:[/b] Like [PopupMenu] and [Tree], [ItemList] supports searching within the list while the control is focused. Press a key that matches the first letter of an item's name to select the first item starting with the given letter. After that point, there are two ways to perform incremental search: 1) Press the same key again before the timeout duration to select the next item starting with the same letter. 2) Press letter keys that match the rest of the word before the timeout duration to match to select the item in question directly. Both of these actions will be reset to the beginning of the list if the timeout duration has passed since the last keystroke was registered. You can adjust the timeout duration by changing [member ProjectSettings.gui/timers/incremental_search_max_interval_msec].
|
[b]Incremental search:[/b] Like [PopupMenu] and [Tree], [ItemList] supports searching within the list while the control is focused. Press a key that matches the first letter of an item's name to select the first item starting with the given letter. After that point, there are two ways to perform incremental search: 1) Press the same key again before the timeout duration to select the next item starting with the same letter. 2) Press letter keys that match the rest of the word before the timeout duration to match to select the item in question directly. Both of these actions will be reset to the beginning of the list if the timeout duration has passed since the last keystroke was registered. You can adjust the timeout duration by changing [member ProjectSettings.gui/timers/incremental_search_max_interval_msec].
|
||||||
</description>
|
</description>
|
||||||
|
@ -213,7 +213,7 @@
|
||||||
<argument index="1" name="disabled" type="bool" />
|
<argument index="1" name="disabled" type="bool" />
|
||||||
<description>
|
<description>
|
||||||
Disables (or enables) the item at the specified index.
|
Disables (or enables) the item at the specified index.
|
||||||
Disabled items cannot be selected and do not trigger activation signals (when double-clicking or pressing Enter).
|
Disabled items cannot be selected and do not trigger activation signals (when double-clicking or pressing [kbd]Enter[/kbd]).
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="set_item_icon">
|
<method name="set_item_icon">
|
||||||
|
@ -355,7 +355,7 @@
|
||||||
<signal name="item_activated">
|
<signal name="item_activated">
|
||||||
<argument index="0" name="index" type="int" />
|
<argument index="0" name="index" type="int" />
|
||||||
<description>
|
<description>
|
||||||
Triggered when specified list item is activated via double-clicking or by pressing Enter.
|
Triggered when specified list item is activated via double-clicking or by pressing [kbd]Enter[/kbd].
|
||||||
</description>
|
</description>
|
||||||
</signal>
|
</signal>
|
||||||
<signal name="item_rmb_selected">
|
<signal name="item_rmb_selected">
|
||||||
|
@ -405,7 +405,7 @@
|
||||||
Only allow selecting a single item.
|
Only allow selecting a single item.
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="SELECT_MULTI" value="1" enum="SelectMode">
|
<constant name="SELECT_MULTI" value="1" enum="SelectMode">
|
||||||
Allows selecting multiple items by holding Ctrl or Shift.
|
Allows selecting multiple items by holding [kbd]Ctrl[/kbd] or [kbd]Shift[/kbd].
|
||||||
</constant>
|
</constant>
|
||||||
</constants>
|
</constants>
|
||||||
<theme_items>
|
<theme_items>
|
||||||
|
|
|
@ -6,24 +6,24 @@
|
||||||
<description>
|
<description>
|
||||||
LineEdit provides a single-line string editor, used for text fields.
|
LineEdit provides a single-line string editor, used for text fields.
|
||||||
It features many built-in shortcuts which will always be available ([code]Ctrl[/code] here maps to [code]Command[/code] on macOS):
|
It features many built-in shortcuts which will always be available ([code]Ctrl[/code] here maps to [code]Command[/code] on macOS):
|
||||||
- Ctrl + C: Copy
|
- [kbd]Ctrl + C[/kbd]: Copy
|
||||||
- Ctrl + X: Cut
|
- [kbd]Ctrl + X[/kbd]: Cut
|
||||||
- Ctrl + V or Ctrl + Y: Paste/"yank"
|
- [kbd]Ctrl + V or Ctrl + Y[/kbd]: Paste/"yank"
|
||||||
- Ctrl + Z: Undo
|
- [kbd]Ctrl + Z[/kbd]: Undo
|
||||||
- Ctrl + Shift + Z: Redo
|
- [kbd]Ctrl + Shift + Z[/kbd]: Redo
|
||||||
- Ctrl + U: Delete text from the cursor position to the beginning of the line
|
- [kbd]Ctrl + U[/kbd]: Delete text from the cursor position to the beginning of the line
|
||||||
- Ctrl + K: Delete text from the cursor position to the end of the line
|
- [kbd]Ctrl + K[/kbd]: Delete text from the cursor position to the end of the line
|
||||||
- Ctrl + A: Select all text
|
- [kbd]Ctrl + A[/kbd]: Select all text
|
||||||
- Up/Down arrow: Move the cursor to the beginning/end of the line
|
- [kbd]Up Arrow[/kbd]/[kbd]Down arrow[/kbd]: Move the cursor to the beginning/end of the line
|
||||||
On macOS, some extra keyboard shortcuts are available:
|
On macOS, some extra keyboard shortcuts are available:
|
||||||
- Ctrl + F: Like the right arrow key, move the cursor one character right
|
- [kbd]Ctrl + F[/kbd]: Same as [kbd]Right Arrow[/kbd], move the cursor one character right
|
||||||
- Ctrl + B: Like the left arrow key, move the cursor one character left
|
- [kbd]Ctrl + B[/kbd]: Same as [kbd]Left Arrow[/kbd], move the cursor one character left
|
||||||
- Ctrl + P: Like the up arrow key, move the cursor to the previous line
|
- [kbd]Ctrl + P[/kbd]: Same as [kbd]Up Arrow[/kbd], move the cursor to the previous line
|
||||||
- Ctrl + N: Like the down arrow key, move the cursor to the next line
|
- [kbd]Ctrl + N[/kbd]: Same as [kbd]Down Arrow[/kbd], move the cursor to the next line
|
||||||
- Ctrl + D: Like the Delete key, delete the character on the right side of cursor
|
- [kbd]Ctrl + D[/kbd]: Same as [kbd]Delete[/kbd], delete the character on the right side of cursor
|
||||||
- Ctrl + H: Like the Backspace key, delete the character on the left side of the cursor
|
- [kbd]Ctrl + H[/kbd]: Same as [kbd]Backspace[/kbd], delete the character on the left side of the cursor
|
||||||
- Command + Left arrow: Like the Home key, move the cursor to the beginning of the line
|
- [kbd]Cmd + Left arrow[/kbd]: Same as [kbd]Home[/kbd], move the cursor to the beginning of the line
|
||||||
- Command + Right arrow: Like the End key, move the cursor to the end of the line
|
- [kbd]Cmd + Right arrow[/kbd]: Same as [kbd]End[/kbd], move the cursor to the end of the line
|
||||||
</description>
|
</description>
|
||||||
<tutorials>
|
<tutorials>
|
||||||
</tutorials>
|
</tutorials>
|
||||||
|
|
|
@ -880,7 +880,7 @@
|
||||||
Implemented on all platforms.
|
Implemented on all platforms.
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="NOTIFICATION_WM_QUIT_REQUEST" value="1006">
|
<constant name="NOTIFICATION_WM_QUIT_REQUEST" value="1006">
|
||||||
Notification received from the OS when a quit request is sent (e.g. closing the window with a "Close" button or Alt+F4).
|
Notification received from the OS when a quit request is sent (e.g. closing the window with a "Close" button or [kbd]Alt + F4[/kbd]).
|
||||||
Implemented on desktop platforms.
|
Implemented on desktop platforms.
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="NOTIFICATION_WM_GO_BACK_REQUEST" value="1007">
|
<constant name="NOTIFICATION_WM_GO_BACK_REQUEST" value="1007">
|
||||||
|
|
|
@ -1008,6 +1008,12 @@ def rstize_text(text, state): # type: (str, State) -> str
|
||||||
tag_depth += 1
|
tag_depth += 1
|
||||||
inside_code = True
|
inside_code = True
|
||||||
escape_pre = True
|
escape_pre = True
|
||||||
|
elif cmd == "kbd":
|
||||||
|
tag_text = ":kbd:`"
|
||||||
|
tag_depth += 1
|
||||||
|
elif cmd == "/kbd":
|
||||||
|
tag_text = "`"
|
||||||
|
tag_depth -= 1
|
||||||
elif cmd.startswith("enum "):
|
elif cmd.startswith("enum "):
|
||||||
tag_text = make_enum(cmd[5:], state)
|
tag_text = make_enum(cmd[5:], state)
|
||||||
escape_pre = True
|
escape_pre = True
|
||||||
|
|
|
@ -258,10 +258,12 @@ void editor_register_fonts(Ref<Theme> p_theme) {
|
||||||
MAKE_BOLD_FONT(df_doc_bold, int(EDITOR_GET("text_editor/help/help_font_size")) * EDSCALE);
|
MAKE_BOLD_FONT(df_doc_bold, int(EDITOR_GET("text_editor/help/help_font_size")) * EDSCALE);
|
||||||
MAKE_BOLD_FONT(df_doc_title, int(EDITOR_GET("text_editor/help/help_title_font_size")) * EDSCALE);
|
MAKE_BOLD_FONT(df_doc_title, int(EDITOR_GET("text_editor/help/help_title_font_size")) * EDSCALE);
|
||||||
MAKE_SOURCE_FONT(df_doc_code, int(EDITOR_GET("text_editor/help/help_source_font_size")) * EDSCALE);
|
MAKE_SOURCE_FONT(df_doc_code, int(EDITOR_GET("text_editor/help/help_source_font_size")) * EDSCALE);
|
||||||
|
MAKE_SOURCE_FONT(df_doc_kbd, (int(EDITOR_GET("text_editor/help/help_source_font_size")) - 1) * EDSCALE);
|
||||||
p_theme->set_font("doc", "EditorFonts", df_doc);
|
p_theme->set_font("doc", "EditorFonts", df_doc);
|
||||||
p_theme->set_font("doc_bold", "EditorFonts", df_doc_bold);
|
p_theme->set_font("doc_bold", "EditorFonts", df_doc_bold);
|
||||||
p_theme->set_font("doc_title", "EditorFonts", df_doc_title);
|
p_theme->set_font("doc_title", "EditorFonts", df_doc_title);
|
||||||
p_theme->set_font("doc_source", "EditorFonts", df_doc_code);
|
p_theme->set_font("doc_source", "EditorFonts", df_doc_code);
|
||||||
|
p_theme->set_font("doc_keyboard", "EditorFonts", df_doc_kbd);
|
||||||
|
|
||||||
// Ruler font
|
// Ruler font
|
||||||
MAKE_DEFAULT_FONT(df_rulers, 8 * EDSCALE);
|
MAKE_DEFAULT_FONT(df_rulers, 8 * EDSCALE);
|
||||||
|
|
|
@ -1282,11 +1282,14 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) {
|
||||||
Ref<Font> doc_font = p_rt->get_font("doc", "EditorFonts");
|
Ref<Font> doc_font = p_rt->get_font("doc", "EditorFonts");
|
||||||
Ref<Font> doc_bold_font = p_rt->get_font("doc_bold", "EditorFonts");
|
Ref<Font> doc_bold_font = p_rt->get_font("doc_bold", "EditorFonts");
|
||||||
Ref<Font> doc_code_font = p_rt->get_font("doc_source", "EditorFonts");
|
Ref<Font> doc_code_font = p_rt->get_font("doc_source", "EditorFonts");
|
||||||
|
Ref<Font> doc_kbd_font = p_rt->get_font("doc_keyboard", "EditorFonts");
|
||||||
|
|
||||||
Color font_color_hl = p_rt->get_color("headline_color", "EditorHelp");
|
Color font_color_hl = p_rt->get_color("headline_color", "EditorHelp");
|
||||||
Color accent_color = p_rt->get_color("accent_color", "Editor");
|
Color accent_color = p_rt->get_color("accent_color", "Editor");
|
||||||
|
Color property_color = p_rt->get_color("property_color", "Editor");
|
||||||
Color link_color = accent_color.linear_interpolate(font_color_hl, 0.8);
|
Color link_color = accent_color.linear_interpolate(font_color_hl, 0.8);
|
||||||
Color code_color = accent_color.linear_interpolate(font_color_hl, 0.6);
|
Color code_color = accent_color.linear_interpolate(font_color_hl, 0.6);
|
||||||
|
Color kbd_color = accent_color.linear_interpolate(property_color, 0.6);
|
||||||
|
|
||||||
String bbcode = p_bbcode.dedent().replace("\t", "").replace("\r", "").strip_edges();
|
String bbcode = p_bbcode.dedent().replace("\t", "").replace("\r", "").strip_edges();
|
||||||
|
|
||||||
|
@ -1396,6 +1399,13 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) {
|
||||||
code_tag = true;
|
code_tag = true;
|
||||||
pos = brk_end + 1;
|
pos = brk_end + 1;
|
||||||
tag_stack.push_front(tag);
|
tag_stack.push_front(tag);
|
||||||
|
} else if (tag == "kbd") {
|
||||||
|
// Use keyboard font with custom color.
|
||||||
|
p_rt->push_font(doc_kbd_font);
|
||||||
|
p_rt->push_color(kbd_color);
|
||||||
|
code_tag = true; // Though not strictly a code tag, logic is similar.
|
||||||
|
pos = brk_end + 1;
|
||||||
|
tag_stack.push_front(tag);
|
||||||
} else if (tag == "center") {
|
} else if (tag == "center") {
|
||||||
// Align to center.
|
// Align to center.
|
||||||
p_rt->push_align(RichTextLabel::ALIGN_CENTER);
|
p_rt->push_align(RichTextLabel::ALIGN_CENTER);
|
||||||
|
|
|
@ -400,8 +400,12 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf
|
||||||
code_tag = true;
|
code_tag = true;
|
||||||
pos = brk_end + 1;
|
pos = brk_end + 1;
|
||||||
tag_stack.push_front(tag);
|
tag_stack.push_front(tag);
|
||||||
|
} else if (tag == "kbd") {
|
||||||
|
// keyboard combinations are not supported in xml comments
|
||||||
|
pos = brk_end + 1;
|
||||||
|
tag_stack.push_front(tag);
|
||||||
} else if (tag == "center") {
|
} else if (tag == "center") {
|
||||||
// center is alignment not supported in xml comments
|
// center alignment is not supported in xml comments
|
||||||
pos = brk_end + 1;
|
pos = brk_end + 1;
|
||||||
tag_stack.push_front(tag);
|
tag_stack.push_front(tag);
|
||||||
} else if (tag == "br") {
|
} else if (tag == "br") {
|
||||||
|
|
Loading…
Reference in a new issue