class_lineedit.rst 72 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643
  1. :github_url: hide
  2. .. meta::
  3. :keywords: text, input
  4. .. DO NOT EDIT THIS FILE!!!
  5. .. Generated automatically from Godot engine sources.
  6. .. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
  7. .. XML source: https://github.com/godotengine/godot/tree/4.3/doc/classes/LineEdit.xml.
  8. .. _class_LineEdit:
  9. LineEdit
  10. ========
  11. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  12. An input field for single-line text.
  13. .. rst-class:: classref-introduction-group
  14. Description
  15. -----------
  16. **LineEdit** provides an input field for editing a single line of text. It features many built-in shortcuts that are always available (:kbd:`Ctrl` here maps to :kbd:`Cmd` on macOS):
  17. - :kbd:`Ctrl + C`: Copy
  18. - :kbd:`Ctrl + X`: Cut
  19. - :kbd:`Ctrl + V` or :kbd:`Ctrl + Y`: Paste/"yank"
  20. - :kbd:`Ctrl + Z`: Undo
  21. - :kbd:`Ctrl + ~`: Swap input direction.
  22. - :kbd:`Ctrl + Shift + Z`: Redo
  23. - :kbd:`Ctrl + U`: Delete text from the caret position to the beginning of the line
  24. - :kbd:`Ctrl + K`: Delete text from the caret position to the end of the line
  25. - :kbd:`Ctrl + A`: Select all text
  26. - :kbd:`Up Arrow`/:kbd:`Down Arrow`: Move the caret to the beginning/end of the line
  27. On macOS, some extra keyboard shortcuts are available:
  28. - :kbd:`Cmd + F`: Same as :kbd:`Right Arrow`, move the caret one character right
  29. - :kbd:`Cmd + B`: Same as :kbd:`Left Arrow`, move the caret one character left
  30. - :kbd:`Cmd + P`: Same as :kbd:`Up Arrow`, move the caret to the previous line
  31. - :kbd:`Cmd + N`: Same as :kbd:`Down Arrow`, move the caret to the next line
  32. - :kbd:`Cmd + D`: Same as :kbd:`Delete`, delete the character on the right side of caret
  33. - :kbd:`Cmd + H`: Same as :kbd:`Backspace`, delete the character on the left side of the caret
  34. - :kbd:`Cmd + A`: Same as :kbd:`Home`, move the caret to the beginning of the line
  35. - :kbd:`Cmd + E`: Same as :kbd:`End`, move the caret to the end of the line
  36. - :kbd:`Cmd + Left Arrow`: Same as :kbd:`Home`, move the caret to the beginning of the line
  37. - :kbd:`Cmd + Right Arrow`: Same as :kbd:`End`, move the caret to the end of the line
  38. .. rst-class:: classref-reftable-group
  39. Properties
  40. ----------
  41. .. table::
  42. :widths: auto
  43. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  44. | :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | :ref:`alignment<class_LineEdit_property_alignment>` | ``0`` |
  45. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  46. | :ref:`bool<class_bool>` | :ref:`caret_blink<class_LineEdit_property_caret_blink>` | ``false`` |
  47. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  48. | :ref:`float<class_float>` | :ref:`caret_blink_interval<class_LineEdit_property_caret_blink_interval>` | ``0.65`` |
  49. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  50. | :ref:`int<class_int>` | :ref:`caret_column<class_LineEdit_property_caret_column>` | ``0`` |
  51. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  52. | :ref:`bool<class_bool>` | :ref:`caret_force_displayed<class_LineEdit_property_caret_force_displayed>` | ``false`` |
  53. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  54. | :ref:`bool<class_bool>` | :ref:`caret_mid_grapheme<class_LineEdit_property_caret_mid_grapheme>` | ``false`` |
  55. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  56. | :ref:`bool<class_bool>` | :ref:`clear_button_enabled<class_LineEdit_property_clear_button_enabled>` | ``false`` |
  57. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  58. | :ref:`bool<class_bool>` | :ref:`context_menu_enabled<class_LineEdit_property_context_menu_enabled>` | ``true`` |
  59. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  60. | :ref:`bool<class_bool>` | :ref:`deselect_on_focus_loss_enabled<class_LineEdit_property_deselect_on_focus_loss_enabled>` | ``true`` |
  61. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  62. | :ref:`bool<class_bool>` | :ref:`drag_and_drop_selection_enabled<class_LineEdit_property_drag_and_drop_selection_enabled>` | ``true`` |
  63. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  64. | :ref:`bool<class_bool>` | :ref:`draw_control_chars<class_LineEdit_property_draw_control_chars>` | ``false`` |
  65. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  66. | :ref:`bool<class_bool>` | :ref:`editable<class_LineEdit_property_editable>` | ``true`` |
  67. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  68. | :ref:`bool<class_bool>` | :ref:`expand_to_text_length<class_LineEdit_property_expand_to_text_length>` | ``false`` |
  69. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  70. | :ref:`bool<class_bool>` | :ref:`flat<class_LineEdit_property_flat>` | ``false`` |
  71. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  72. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
  73. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  74. | :ref:`String<class_String>` | :ref:`language<class_LineEdit_property_language>` | ``""`` |
  75. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  76. | :ref:`int<class_int>` | :ref:`max_length<class_LineEdit_property_max_length>` | ``0`` |
  77. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  78. | :ref:`bool<class_bool>` | :ref:`middle_mouse_paste_enabled<class_LineEdit_property_middle_mouse_paste_enabled>` | ``true`` |
  79. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  80. | :ref:`CursorShape<enum_Control_CursorShape>` | mouse_default_cursor_shape | ``1`` (overrides :ref:`Control<class_Control_property_mouse_default_cursor_shape>`) |
  81. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  82. | :ref:`String<class_String>` | :ref:`placeholder_text<class_LineEdit_property_placeholder_text>` | ``""`` |
  83. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  84. | :ref:`Texture2D<class_Texture2D>` | :ref:`right_icon<class_LineEdit_property_right_icon>` | |
  85. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  86. | :ref:`bool<class_bool>` | :ref:`secret<class_LineEdit_property_secret>` | ``false`` |
  87. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  88. | :ref:`String<class_String>` | :ref:`secret_character<class_LineEdit_property_secret_character>` | ``"•"`` |
  89. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  90. | :ref:`bool<class_bool>` | :ref:`select_all_on_focus<class_LineEdit_property_select_all_on_focus>` | ``false`` |
  91. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  92. | :ref:`bool<class_bool>` | :ref:`selecting_enabled<class_LineEdit_property_selecting_enabled>` | ``true`` |
  93. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  94. | :ref:`bool<class_bool>` | :ref:`shortcut_keys_enabled<class_LineEdit_property_shortcut_keys_enabled>` | ``true`` |
  95. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  96. | :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` | :ref:`structured_text_bidi_override<class_LineEdit_property_structured_text_bidi_override>` | ``0`` |
  97. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  98. | :ref:`Array<class_Array>` | :ref:`structured_text_bidi_override_options<class_LineEdit_property_structured_text_bidi_override_options>` | ``[]`` |
  99. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  100. | :ref:`String<class_String>` | :ref:`text<class_LineEdit_property_text>` | ``""`` |
  101. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  102. | :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`text_direction<class_LineEdit_property_text_direction>` | ``0`` |
  103. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  104. | :ref:`bool<class_bool>` | :ref:`virtual_keyboard_enabled<class_LineEdit_property_virtual_keyboard_enabled>` | ``true`` |
  105. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  106. | :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` | :ref:`virtual_keyboard_type<class_LineEdit_property_virtual_keyboard_type>` | ``0`` |
  107. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  108. .. rst-class:: classref-reftable-group
  109. Methods
  110. -------
  111. .. table::
  112. :widths: auto
  113. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  114. | |void| | :ref:`clear<class_LineEdit_method_clear>`\ (\ ) |
  115. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  116. | |void| | :ref:`delete_char_at_caret<class_LineEdit_method_delete_char_at_caret>`\ (\ ) |
  117. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  118. | |void| | :ref:`delete_text<class_LineEdit_method_delete_text>`\ (\ from_column\: :ref:`int<class_int>`, to_column\: :ref:`int<class_int>`\ ) |
  119. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  120. | |void| | :ref:`deselect<class_LineEdit_method_deselect>`\ (\ ) |
  121. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  122. | :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_menu<class_LineEdit_method_get_menu>`\ (\ ) |const| |
  123. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  124. | :ref:`float<class_float>` | :ref:`get_scroll_offset<class_LineEdit_method_get_scroll_offset>`\ (\ ) |const| |
  125. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  126. | :ref:`String<class_String>` | :ref:`get_selected_text<class_LineEdit_method_get_selected_text>`\ (\ ) |
  127. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  128. | :ref:`int<class_int>` | :ref:`get_selection_from_column<class_LineEdit_method_get_selection_from_column>`\ (\ ) |const| |
  129. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  130. | :ref:`int<class_int>` | :ref:`get_selection_to_column<class_LineEdit_method_get_selection_to_column>`\ (\ ) |const| |
  131. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  132. | :ref:`bool<class_bool>` | :ref:`has_selection<class_LineEdit_method_has_selection>`\ (\ ) |const| |
  133. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  134. | |void| | :ref:`insert_text_at_caret<class_LineEdit_method_insert_text_at_caret>`\ (\ text\: :ref:`String<class_String>`\ ) |
  135. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  136. | :ref:`bool<class_bool>` | :ref:`is_menu_visible<class_LineEdit_method_is_menu_visible>`\ (\ ) |const| |
  137. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  138. | |void| | :ref:`menu_option<class_LineEdit_method_menu_option>`\ (\ option\: :ref:`int<class_int>`\ ) |
  139. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  140. | |void| | :ref:`select<class_LineEdit_method_select>`\ (\ from\: :ref:`int<class_int>` = 0, to\: :ref:`int<class_int>` = -1\ ) |
  141. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  142. | |void| | :ref:`select_all<class_LineEdit_method_select_all>`\ (\ ) |
  143. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  144. .. rst-class:: classref-reftable-group
  145. Theme Properties
  146. ----------------
  147. .. table::
  148. :widths: auto
  149. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  150. | :ref:`Color<class_Color>` | :ref:`caret_color<class_LineEdit_theme_color_caret_color>` | ``Color(0.95, 0.95, 0.95, 1)`` |
  151. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  152. | :ref:`Color<class_Color>` | :ref:`clear_button_color<class_LineEdit_theme_color_clear_button_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  153. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  154. | :ref:`Color<class_Color>` | :ref:`clear_button_color_pressed<class_LineEdit_theme_color_clear_button_color_pressed>` | ``Color(1, 1, 1, 1)`` |
  155. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  156. | :ref:`Color<class_Color>` | :ref:`font_color<class_LineEdit_theme_color_font_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  157. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  158. | :ref:`Color<class_Color>` | :ref:`font_outline_color<class_LineEdit_theme_color_font_outline_color>` | ``Color(0, 0, 0, 1)`` |
  159. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  160. | :ref:`Color<class_Color>` | :ref:`font_placeholder_color<class_LineEdit_theme_color_font_placeholder_color>` | ``Color(0.875, 0.875, 0.875, 0.6)`` |
  161. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  162. | :ref:`Color<class_Color>` | :ref:`font_selected_color<class_LineEdit_theme_color_font_selected_color>` | ``Color(1, 1, 1, 1)`` |
  163. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  164. | :ref:`Color<class_Color>` | :ref:`font_uneditable_color<class_LineEdit_theme_color_font_uneditable_color>` | ``Color(0.875, 0.875, 0.875, 0.5)`` |
  165. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  166. | :ref:`Color<class_Color>` | :ref:`selection_color<class_LineEdit_theme_color_selection_color>` | ``Color(0.5, 0.5, 0.5, 1)`` |
  167. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  168. | :ref:`int<class_int>` | :ref:`caret_width<class_LineEdit_theme_constant_caret_width>` | ``1`` |
  169. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  170. | :ref:`int<class_int>` | :ref:`minimum_character_width<class_LineEdit_theme_constant_minimum_character_width>` | ``4`` |
  171. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  172. | :ref:`int<class_int>` | :ref:`outline_size<class_LineEdit_theme_constant_outline_size>` | ``0`` |
  173. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  174. | :ref:`Font<class_Font>` | :ref:`font<class_LineEdit_theme_font_font>` | |
  175. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  176. | :ref:`int<class_int>` | :ref:`font_size<class_LineEdit_theme_font_size_font_size>` | |
  177. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  178. | :ref:`Texture2D<class_Texture2D>` | :ref:`clear<class_LineEdit_theme_icon_clear>` | |
  179. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  180. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_LineEdit_theme_style_focus>` | |
  181. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  182. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_LineEdit_theme_style_normal>` | |
  183. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  184. | :ref:`StyleBox<class_StyleBox>` | :ref:`read_only<class_LineEdit_theme_style_read_only>` | |
  185. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  186. .. rst-class:: classref-section-separator
  187. ----
  188. .. rst-class:: classref-descriptions-group
  189. Signals
  190. -------
  191. .. _class_LineEdit_signal_text_change_rejected:
  192. .. rst-class:: classref-signal
  193. **text_change_rejected**\ (\ rejected_substring\: :ref:`String<class_String>`\ ) :ref:`🔗<class_LineEdit_signal_text_change_rejected>`
  194. Emitted when appending text that overflows the :ref:`max_length<class_LineEdit_property_max_length>`. The appended text is truncated to fit :ref:`max_length<class_LineEdit_property_max_length>`, and the part that couldn't fit is passed as the ``rejected_substring`` argument.
  195. .. rst-class:: classref-item-separator
  196. ----
  197. .. _class_LineEdit_signal_text_changed:
  198. .. rst-class:: classref-signal
  199. **text_changed**\ (\ new_text\: :ref:`String<class_String>`\ ) :ref:`🔗<class_LineEdit_signal_text_changed>`
  200. Emitted when the text changes.
  201. .. rst-class:: classref-item-separator
  202. ----
  203. .. _class_LineEdit_signal_text_submitted:
  204. .. rst-class:: classref-signal
  205. **text_submitted**\ (\ new_text\: :ref:`String<class_String>`\ ) :ref:`🔗<class_LineEdit_signal_text_submitted>`
  206. Emitted when the user presses :ref:`@GlobalScope.KEY_ENTER<class_@GlobalScope_constant_KEY_ENTER>` on the **LineEdit**.
  207. .. rst-class:: classref-section-separator
  208. ----
  209. .. rst-class:: classref-descriptions-group
  210. Enumerations
  211. ------------
  212. .. _enum_LineEdit_MenuItems:
  213. .. rst-class:: classref-enumeration
  214. enum **MenuItems**: :ref:`🔗<enum_LineEdit_MenuItems>`
  215. .. _class_LineEdit_constant_MENU_CUT:
  216. .. rst-class:: classref-enumeration-constant
  217. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_CUT** = ``0``
  218. Cuts (copies and clears) the selected text.
  219. .. _class_LineEdit_constant_MENU_COPY:
  220. .. rst-class:: classref-enumeration-constant
  221. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_COPY** = ``1``
  222. Copies the selected text.
  223. .. _class_LineEdit_constant_MENU_PASTE:
  224. .. rst-class:: classref-enumeration-constant
  225. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_PASTE** = ``2``
  226. Pastes the clipboard text over the selected text (or at the caret's position).
  227. Non-printable escape characters are automatically stripped from the OS clipboard via :ref:`String.strip_escapes<class_String_method_strip_escapes>`.
  228. .. _class_LineEdit_constant_MENU_CLEAR:
  229. .. rst-class:: classref-enumeration-constant
  230. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_CLEAR** = ``3``
  231. Erases the whole **LineEdit** text.
  232. .. _class_LineEdit_constant_MENU_SELECT_ALL:
  233. .. rst-class:: classref-enumeration-constant
  234. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_SELECT_ALL** = ``4``
  235. Selects the whole **LineEdit** text.
  236. .. _class_LineEdit_constant_MENU_UNDO:
  237. .. rst-class:: classref-enumeration-constant
  238. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_UNDO** = ``5``
  239. Undoes the previous action.
  240. .. _class_LineEdit_constant_MENU_REDO:
  241. .. rst-class:: classref-enumeration-constant
  242. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_REDO** = ``6``
  243. Reverse the last undo action.
  244. .. _class_LineEdit_constant_MENU_SUBMENU_TEXT_DIR:
  245. .. rst-class:: classref-enumeration-constant
  246. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_SUBMENU_TEXT_DIR** = ``7``
  247. ID of "Text Writing Direction" submenu.
  248. .. _class_LineEdit_constant_MENU_DIR_INHERITED:
  249. .. rst-class:: classref-enumeration-constant
  250. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DIR_INHERITED** = ``8``
  251. Sets text direction to inherited.
  252. .. _class_LineEdit_constant_MENU_DIR_AUTO:
  253. .. rst-class:: classref-enumeration-constant
  254. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DIR_AUTO** = ``9``
  255. Sets text direction to automatic.
  256. .. _class_LineEdit_constant_MENU_DIR_LTR:
  257. .. rst-class:: classref-enumeration-constant
  258. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DIR_LTR** = ``10``
  259. Sets text direction to left-to-right.
  260. .. _class_LineEdit_constant_MENU_DIR_RTL:
  261. .. rst-class:: classref-enumeration-constant
  262. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DIR_RTL** = ``11``
  263. Sets text direction to right-to-left.
  264. .. _class_LineEdit_constant_MENU_DISPLAY_UCC:
  265. .. rst-class:: classref-enumeration-constant
  266. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DISPLAY_UCC** = ``12``
  267. Toggles control character display.
  268. .. _class_LineEdit_constant_MENU_SUBMENU_INSERT_UCC:
  269. .. rst-class:: classref-enumeration-constant
  270. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_SUBMENU_INSERT_UCC** = ``13``
  271. ID of "Insert Control Character" submenu.
  272. .. _class_LineEdit_constant_MENU_INSERT_LRM:
  273. .. rst-class:: classref-enumeration-constant
  274. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_LRM** = ``14``
  275. Inserts left-to-right mark (LRM) character.
  276. .. _class_LineEdit_constant_MENU_INSERT_RLM:
  277. .. rst-class:: classref-enumeration-constant
  278. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_RLM** = ``15``
  279. Inserts right-to-left mark (RLM) character.
  280. .. _class_LineEdit_constant_MENU_INSERT_LRE:
  281. .. rst-class:: classref-enumeration-constant
  282. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_LRE** = ``16``
  283. Inserts start of left-to-right embedding (LRE) character.
  284. .. _class_LineEdit_constant_MENU_INSERT_RLE:
  285. .. rst-class:: classref-enumeration-constant
  286. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_RLE** = ``17``
  287. Inserts start of right-to-left embedding (RLE) character.
  288. .. _class_LineEdit_constant_MENU_INSERT_LRO:
  289. .. rst-class:: classref-enumeration-constant
  290. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_LRO** = ``18``
  291. Inserts start of left-to-right override (LRO) character.
  292. .. _class_LineEdit_constant_MENU_INSERT_RLO:
  293. .. rst-class:: classref-enumeration-constant
  294. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_RLO** = ``19``
  295. Inserts start of right-to-left override (RLO) character.
  296. .. _class_LineEdit_constant_MENU_INSERT_PDF:
  297. .. rst-class:: classref-enumeration-constant
  298. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_PDF** = ``20``
  299. Inserts pop direction formatting (PDF) character.
  300. .. _class_LineEdit_constant_MENU_INSERT_ALM:
  301. .. rst-class:: classref-enumeration-constant
  302. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_ALM** = ``21``
  303. Inserts Arabic letter mark (ALM) character.
  304. .. _class_LineEdit_constant_MENU_INSERT_LRI:
  305. .. rst-class:: classref-enumeration-constant
  306. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_LRI** = ``22``
  307. Inserts left-to-right isolate (LRI) character.
  308. .. _class_LineEdit_constant_MENU_INSERT_RLI:
  309. .. rst-class:: classref-enumeration-constant
  310. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_RLI** = ``23``
  311. Inserts right-to-left isolate (RLI) character.
  312. .. _class_LineEdit_constant_MENU_INSERT_FSI:
  313. .. rst-class:: classref-enumeration-constant
  314. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_FSI** = ``24``
  315. Inserts first strong isolate (FSI) character.
  316. .. _class_LineEdit_constant_MENU_INSERT_PDI:
  317. .. rst-class:: classref-enumeration-constant
  318. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_PDI** = ``25``
  319. Inserts pop direction isolate (PDI) character.
  320. .. _class_LineEdit_constant_MENU_INSERT_ZWJ:
  321. .. rst-class:: classref-enumeration-constant
  322. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_ZWJ** = ``26``
  323. Inserts zero width joiner (ZWJ) character.
  324. .. _class_LineEdit_constant_MENU_INSERT_ZWNJ:
  325. .. rst-class:: classref-enumeration-constant
  326. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_ZWNJ** = ``27``
  327. Inserts zero width non-joiner (ZWNJ) character.
  328. .. _class_LineEdit_constant_MENU_INSERT_WJ:
  329. .. rst-class:: classref-enumeration-constant
  330. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_WJ** = ``28``
  331. Inserts word joiner (WJ) character.
  332. .. _class_LineEdit_constant_MENU_INSERT_SHY:
  333. .. rst-class:: classref-enumeration-constant
  334. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_SHY** = ``29``
  335. Inserts soft hyphen (SHY) character.
  336. .. _class_LineEdit_constant_MENU_MAX:
  337. .. rst-class:: classref-enumeration-constant
  338. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_MAX** = ``30``
  339. Represents the size of the :ref:`MenuItems<enum_LineEdit_MenuItems>` enum.
  340. .. rst-class:: classref-item-separator
  341. ----
  342. .. _enum_LineEdit_VirtualKeyboardType:
  343. .. rst-class:: classref-enumeration
  344. enum **VirtualKeyboardType**: :ref:`🔗<enum_LineEdit_VirtualKeyboardType>`
  345. .. _class_LineEdit_constant_KEYBOARD_TYPE_DEFAULT:
  346. .. rst-class:: classref-enumeration-constant
  347. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_DEFAULT** = ``0``
  348. Default text virtual keyboard.
  349. .. _class_LineEdit_constant_KEYBOARD_TYPE_MULTILINE:
  350. .. rst-class:: classref-enumeration-constant
  351. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_MULTILINE** = ``1``
  352. Multiline virtual keyboard.
  353. .. _class_LineEdit_constant_KEYBOARD_TYPE_NUMBER:
  354. .. rst-class:: classref-enumeration-constant
  355. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER** = ``2``
  356. Virtual number keypad, useful for PIN entry.
  357. .. _class_LineEdit_constant_KEYBOARD_TYPE_NUMBER_DECIMAL:
  358. .. rst-class:: classref-enumeration-constant
  359. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER_DECIMAL** = ``3``
  360. Virtual number keypad, useful for entering fractional numbers.
  361. .. _class_LineEdit_constant_KEYBOARD_TYPE_PHONE:
  362. .. rst-class:: classref-enumeration-constant
  363. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_PHONE** = ``4``
  364. Virtual phone number keypad.
  365. .. _class_LineEdit_constant_KEYBOARD_TYPE_EMAIL_ADDRESS:
  366. .. rst-class:: classref-enumeration-constant
  367. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_EMAIL_ADDRESS** = ``5``
  368. Virtual keyboard with additional keys to assist with typing email addresses.
  369. .. _class_LineEdit_constant_KEYBOARD_TYPE_PASSWORD:
  370. .. rst-class:: classref-enumeration-constant
  371. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_PASSWORD** = ``6``
  372. Virtual keyboard for entering a password. On most platforms, this should disable autocomplete and autocapitalization.
  373. \ **Note:** This is not supported on Web. Instead, this behaves identically to :ref:`KEYBOARD_TYPE_DEFAULT<class_LineEdit_constant_KEYBOARD_TYPE_DEFAULT>`.
  374. .. _class_LineEdit_constant_KEYBOARD_TYPE_URL:
  375. .. rst-class:: classref-enumeration-constant
  376. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_URL** = ``7``
  377. Virtual keyboard with additional keys to assist with typing URLs.
  378. .. rst-class:: classref-section-separator
  379. ----
  380. .. rst-class:: classref-descriptions-group
  381. Property Descriptions
  382. ---------------------
  383. .. _class_LineEdit_property_alignment:
  384. .. rst-class:: classref-property
  385. :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **alignment** = ``0`` :ref:`🔗<class_LineEdit_property_alignment>`
  386. .. rst-class:: classref-property-setget
  387. - |void| **set_horizontal_alignment**\ (\ value\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>`\ )
  388. - :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **get_horizontal_alignment**\ (\ )
  389. Text alignment as defined in the :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` enum.
  390. .. rst-class:: classref-item-separator
  391. ----
  392. .. _class_LineEdit_property_caret_blink:
  393. .. rst-class:: classref-property
  394. :ref:`bool<class_bool>` **caret_blink** = ``false`` :ref:`🔗<class_LineEdit_property_caret_blink>`
  395. .. rst-class:: classref-property-setget
  396. - |void| **set_caret_blink_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  397. - :ref:`bool<class_bool>` **is_caret_blink_enabled**\ (\ )
  398. If ``true``, makes the caret blink.
  399. .. rst-class:: classref-item-separator
  400. ----
  401. .. _class_LineEdit_property_caret_blink_interval:
  402. .. rst-class:: classref-property
  403. :ref:`float<class_float>` **caret_blink_interval** = ``0.65`` :ref:`🔗<class_LineEdit_property_caret_blink_interval>`
  404. .. rst-class:: classref-property-setget
  405. - |void| **set_caret_blink_interval**\ (\ value\: :ref:`float<class_float>`\ )
  406. - :ref:`float<class_float>` **get_caret_blink_interval**\ (\ )
  407. The interval at which the caret blinks (in seconds).
  408. .. rst-class:: classref-item-separator
  409. ----
  410. .. _class_LineEdit_property_caret_column:
  411. .. rst-class:: classref-property
  412. :ref:`int<class_int>` **caret_column** = ``0`` :ref:`🔗<class_LineEdit_property_caret_column>`
  413. .. rst-class:: classref-property-setget
  414. - |void| **set_caret_column**\ (\ value\: :ref:`int<class_int>`\ )
  415. - :ref:`int<class_int>` **get_caret_column**\ (\ )
  416. The caret's column position inside the **LineEdit**. When set, the text may scroll to accommodate it.
  417. .. rst-class:: classref-item-separator
  418. ----
  419. .. _class_LineEdit_property_caret_force_displayed:
  420. .. rst-class:: classref-property
  421. :ref:`bool<class_bool>` **caret_force_displayed** = ``false`` :ref:`🔗<class_LineEdit_property_caret_force_displayed>`
  422. .. rst-class:: classref-property-setget
  423. - |void| **set_caret_force_displayed**\ (\ value\: :ref:`bool<class_bool>`\ )
  424. - :ref:`bool<class_bool>` **is_caret_force_displayed**\ (\ )
  425. If ``true``, the **LineEdit** will always show the caret, even if focus is lost.
  426. .. rst-class:: classref-item-separator
  427. ----
  428. .. _class_LineEdit_property_caret_mid_grapheme:
  429. .. rst-class:: classref-property
  430. :ref:`bool<class_bool>` **caret_mid_grapheme** = ``false`` :ref:`🔗<class_LineEdit_property_caret_mid_grapheme>`
  431. .. rst-class:: classref-property-setget
  432. - |void| **set_caret_mid_grapheme_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  433. - :ref:`bool<class_bool>` **is_caret_mid_grapheme_enabled**\ (\ )
  434. Allow moving caret, selecting and removing the individual composite character components.
  435. \ **Note:** :kbd:`Backspace` is always removing individual composite character components.
  436. .. rst-class:: classref-item-separator
  437. ----
  438. .. _class_LineEdit_property_clear_button_enabled:
  439. .. rst-class:: classref-property
  440. :ref:`bool<class_bool>` **clear_button_enabled** = ``false`` :ref:`🔗<class_LineEdit_property_clear_button_enabled>`
  441. .. rst-class:: classref-property-setget
  442. - |void| **set_clear_button_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  443. - :ref:`bool<class_bool>` **is_clear_button_enabled**\ (\ )
  444. If ``true``, the **LineEdit** will show a clear button if :ref:`text<class_LineEdit_property_text>` is not empty, which can be used to clear the text quickly.
  445. .. rst-class:: classref-item-separator
  446. ----
  447. .. _class_LineEdit_property_context_menu_enabled:
  448. .. rst-class:: classref-property
  449. :ref:`bool<class_bool>` **context_menu_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_context_menu_enabled>`
  450. .. rst-class:: classref-property-setget
  451. - |void| **set_context_menu_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  452. - :ref:`bool<class_bool>` **is_context_menu_enabled**\ (\ )
  453. If ``true``, the context menu will appear when right-clicked.
  454. .. rst-class:: classref-item-separator
  455. ----
  456. .. _class_LineEdit_property_deselect_on_focus_loss_enabled:
  457. .. rst-class:: classref-property
  458. :ref:`bool<class_bool>` **deselect_on_focus_loss_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_deselect_on_focus_loss_enabled>`
  459. .. rst-class:: classref-property-setget
  460. - |void| **set_deselect_on_focus_loss_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  461. - :ref:`bool<class_bool>` **is_deselect_on_focus_loss_enabled**\ (\ )
  462. If ``true``, the selected text will be deselected when focus is lost.
  463. .. rst-class:: classref-item-separator
  464. ----
  465. .. _class_LineEdit_property_drag_and_drop_selection_enabled:
  466. .. rst-class:: classref-property
  467. :ref:`bool<class_bool>` **drag_and_drop_selection_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_drag_and_drop_selection_enabled>`
  468. .. rst-class:: classref-property-setget
  469. - |void| **set_drag_and_drop_selection_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  470. - :ref:`bool<class_bool>` **is_drag_and_drop_selection_enabled**\ (\ )
  471. If ``true``, allow drag and drop of selected text.
  472. .. rst-class:: classref-item-separator
  473. ----
  474. .. _class_LineEdit_property_draw_control_chars:
  475. .. rst-class:: classref-property
  476. :ref:`bool<class_bool>` **draw_control_chars** = ``false`` :ref:`🔗<class_LineEdit_property_draw_control_chars>`
  477. .. rst-class:: classref-property-setget
  478. - |void| **set_draw_control_chars**\ (\ value\: :ref:`bool<class_bool>`\ )
  479. - :ref:`bool<class_bool>` **get_draw_control_chars**\ (\ )
  480. If ``true``, control characters are displayed.
  481. .. rst-class:: classref-item-separator
  482. ----
  483. .. _class_LineEdit_property_editable:
  484. .. rst-class:: classref-property
  485. :ref:`bool<class_bool>` **editable** = ``true`` :ref:`🔗<class_LineEdit_property_editable>`
  486. .. rst-class:: classref-property-setget
  487. - |void| **set_editable**\ (\ value\: :ref:`bool<class_bool>`\ )
  488. - :ref:`bool<class_bool>` **is_editable**\ (\ )
  489. If ``false``, existing text cannot be modified and new text cannot be added.
  490. .. rst-class:: classref-item-separator
  491. ----
  492. .. _class_LineEdit_property_expand_to_text_length:
  493. .. rst-class:: classref-property
  494. :ref:`bool<class_bool>` **expand_to_text_length** = ``false`` :ref:`🔗<class_LineEdit_property_expand_to_text_length>`
  495. .. rst-class:: classref-property-setget
  496. - |void| **set_expand_to_text_length_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  497. - :ref:`bool<class_bool>` **is_expand_to_text_length_enabled**\ (\ )
  498. If ``true``, the **LineEdit** width will increase to stay longer than the :ref:`text<class_LineEdit_property_text>`. It will **not** compress if the :ref:`text<class_LineEdit_property_text>` is shortened.
  499. .. rst-class:: classref-item-separator
  500. ----
  501. .. _class_LineEdit_property_flat:
  502. .. rst-class:: classref-property
  503. :ref:`bool<class_bool>` **flat** = ``false`` :ref:`🔗<class_LineEdit_property_flat>`
  504. .. rst-class:: classref-property-setget
  505. - |void| **set_flat**\ (\ value\: :ref:`bool<class_bool>`\ )
  506. - :ref:`bool<class_bool>` **is_flat**\ (\ )
  507. If ``true``, the **LineEdit** doesn't display decoration.
  508. .. rst-class:: classref-item-separator
  509. ----
  510. .. _class_LineEdit_property_language:
  511. .. rst-class:: classref-property
  512. :ref:`String<class_String>` **language** = ``""`` :ref:`🔗<class_LineEdit_property_language>`
  513. .. rst-class:: classref-property-setget
  514. - |void| **set_language**\ (\ value\: :ref:`String<class_String>`\ )
  515. - :ref:`String<class_String>` **get_language**\ (\ )
  516. Language code used for line-breaking and text shaping algorithms. If left empty, current locale is used instead.
  517. .. rst-class:: classref-item-separator
  518. ----
  519. .. _class_LineEdit_property_max_length:
  520. .. rst-class:: classref-property
  521. :ref:`int<class_int>` **max_length** = ``0`` :ref:`🔗<class_LineEdit_property_max_length>`
  522. .. rst-class:: classref-property-setget
  523. - |void| **set_max_length**\ (\ value\: :ref:`int<class_int>`\ )
  524. - :ref:`int<class_int>` **get_max_length**\ (\ )
  525. Maximum number of characters that can be entered inside the **LineEdit**. If ``0``, there is no limit.
  526. When a limit is defined, characters that would exceed :ref:`max_length<class_LineEdit_property_max_length>` are truncated. This happens both for existing :ref:`text<class_LineEdit_property_text>` contents when setting the max length, or for new text inserted in the **LineEdit**, including pasting. If any input text is truncated, the :ref:`text_change_rejected<class_LineEdit_signal_text_change_rejected>` signal is emitted with the truncated substring as parameter.
  527. \ **Example:**\
  528. .. tabs::
  529. .. code-tab:: gdscript
  530. text = "Hello world"
  531. max_length = 5
  532. # `text` becomes "Hello".
  533. max_length = 10
  534. text += " goodbye"
  535. # `text` becomes "Hello good".
  536. # `text_change_rejected` is emitted with "bye" as parameter.
  537. .. code-tab:: csharp
  538. Text = "Hello world";
  539. MaxLength = 5;
  540. // `Text` becomes "Hello".
  541. MaxLength = 10;
  542. Text += " goodbye";
  543. // `Text` becomes "Hello good".
  544. // `text_change_rejected` is emitted with "bye" as parameter.
  545. .. rst-class:: classref-item-separator
  546. ----
  547. .. _class_LineEdit_property_middle_mouse_paste_enabled:
  548. .. rst-class:: classref-property
  549. :ref:`bool<class_bool>` **middle_mouse_paste_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_middle_mouse_paste_enabled>`
  550. .. rst-class:: classref-property-setget
  551. - |void| **set_middle_mouse_paste_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  552. - :ref:`bool<class_bool>` **is_middle_mouse_paste_enabled**\ (\ )
  553. If ``false``, using middle mouse button to paste clipboard will be disabled.
  554. \ **Note:** This method is only implemented on Linux.
  555. .. rst-class:: classref-item-separator
  556. ----
  557. .. _class_LineEdit_property_placeholder_text:
  558. .. rst-class:: classref-property
  559. :ref:`String<class_String>` **placeholder_text** = ``""`` :ref:`🔗<class_LineEdit_property_placeholder_text>`
  560. .. rst-class:: classref-property-setget
  561. - |void| **set_placeholder**\ (\ value\: :ref:`String<class_String>`\ )
  562. - :ref:`String<class_String>` **get_placeholder**\ (\ )
  563. Text shown when the **LineEdit** is empty. It is **not** the **LineEdit**'s default value (see :ref:`text<class_LineEdit_property_text>`).
  564. .. rst-class:: classref-item-separator
  565. ----
  566. .. _class_LineEdit_property_right_icon:
  567. .. rst-class:: classref-property
  568. :ref:`Texture2D<class_Texture2D>` **right_icon** :ref:`🔗<class_LineEdit_property_right_icon>`
  569. .. rst-class:: classref-property-setget
  570. - |void| **set_right_icon**\ (\ value\: :ref:`Texture2D<class_Texture2D>`\ )
  571. - :ref:`Texture2D<class_Texture2D>` **get_right_icon**\ (\ )
  572. Sets the icon that will appear in the right end of the **LineEdit** if there's no :ref:`text<class_LineEdit_property_text>`, or always, if :ref:`clear_button_enabled<class_LineEdit_property_clear_button_enabled>` is set to ``false``.
  573. .. rst-class:: classref-item-separator
  574. ----
  575. .. _class_LineEdit_property_secret:
  576. .. rst-class:: classref-property
  577. :ref:`bool<class_bool>` **secret** = ``false`` :ref:`🔗<class_LineEdit_property_secret>`
  578. .. rst-class:: classref-property-setget
  579. - |void| **set_secret**\ (\ value\: :ref:`bool<class_bool>`\ )
  580. - :ref:`bool<class_bool>` **is_secret**\ (\ )
  581. If ``true``, every character is replaced with the secret character (see :ref:`secret_character<class_LineEdit_property_secret_character>`).
  582. .. rst-class:: classref-item-separator
  583. ----
  584. .. _class_LineEdit_property_secret_character:
  585. .. rst-class:: classref-property
  586. :ref:`String<class_String>` **secret_character** = ``"•"`` :ref:`🔗<class_LineEdit_property_secret_character>`
  587. .. rst-class:: classref-property-setget
  588. - |void| **set_secret_character**\ (\ value\: :ref:`String<class_String>`\ )
  589. - :ref:`String<class_String>` **get_secret_character**\ (\ )
  590. The character to use to mask secret input. Only a single character can be used as the secret character. If it is longer than one character, only the first one will be used. If it is empty, a space will be used instead.
  591. .. rst-class:: classref-item-separator
  592. ----
  593. .. _class_LineEdit_property_select_all_on_focus:
  594. .. rst-class:: classref-property
  595. :ref:`bool<class_bool>` **select_all_on_focus** = ``false`` :ref:`🔗<class_LineEdit_property_select_all_on_focus>`
  596. .. rst-class:: classref-property-setget
  597. - |void| **set_select_all_on_focus**\ (\ value\: :ref:`bool<class_bool>`\ )
  598. - :ref:`bool<class_bool>` **is_select_all_on_focus**\ (\ )
  599. If ``true``, the **LineEdit** will select the whole text when it gains focus.
  600. .. rst-class:: classref-item-separator
  601. ----
  602. .. _class_LineEdit_property_selecting_enabled:
  603. .. rst-class:: classref-property
  604. :ref:`bool<class_bool>` **selecting_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_selecting_enabled>`
  605. .. rst-class:: classref-property-setget
  606. - |void| **set_selecting_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  607. - :ref:`bool<class_bool>` **is_selecting_enabled**\ (\ )
  608. If ``false``, it's impossible to select the text using mouse nor keyboard.
  609. .. rst-class:: classref-item-separator
  610. ----
  611. .. _class_LineEdit_property_shortcut_keys_enabled:
  612. .. rst-class:: classref-property
  613. :ref:`bool<class_bool>` **shortcut_keys_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_shortcut_keys_enabled>`
  614. .. rst-class:: classref-property-setget
  615. - |void| **set_shortcut_keys_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  616. - :ref:`bool<class_bool>` **is_shortcut_keys_enabled**\ (\ )
  617. If ``false``, using shortcuts will be disabled.
  618. .. rst-class:: classref-item-separator
  619. ----
  620. .. _class_LineEdit_property_structured_text_bidi_override:
  621. .. rst-class:: classref-property
  622. :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **structured_text_bidi_override** = ``0`` :ref:`🔗<class_LineEdit_property_structured_text_bidi_override>`
  623. .. rst-class:: classref-property-setget
  624. - |void| **set_structured_text_bidi_override**\ (\ value\: :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>`\ )
  625. - :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **get_structured_text_bidi_override**\ (\ )
  626. Set BiDi algorithm override for the structured text.
  627. .. rst-class:: classref-item-separator
  628. ----
  629. .. _class_LineEdit_property_structured_text_bidi_override_options:
  630. .. rst-class:: classref-property
  631. :ref:`Array<class_Array>` **structured_text_bidi_override_options** = ``[]`` :ref:`🔗<class_LineEdit_property_structured_text_bidi_override_options>`
  632. .. rst-class:: classref-property-setget
  633. - |void| **set_structured_text_bidi_override_options**\ (\ value\: :ref:`Array<class_Array>`\ )
  634. - :ref:`Array<class_Array>` **get_structured_text_bidi_override_options**\ (\ )
  635. Set additional options for BiDi override.
  636. .. rst-class:: classref-item-separator
  637. ----
  638. .. _class_LineEdit_property_text:
  639. .. rst-class:: classref-property
  640. :ref:`String<class_String>` **text** = ``""`` :ref:`🔗<class_LineEdit_property_text>`
  641. .. rst-class:: classref-property-setget
  642. - |void| **set_text**\ (\ value\: :ref:`String<class_String>`\ )
  643. - :ref:`String<class_String>` **get_text**\ (\ )
  644. String value of the **LineEdit**.
  645. \ **Note:** Changing text using this property won't emit the :ref:`text_changed<class_LineEdit_signal_text_changed>` signal.
  646. .. rst-class:: classref-item-separator
  647. ----
  648. .. _class_LineEdit_property_text_direction:
  649. .. rst-class:: classref-property
  650. :ref:`TextDirection<enum_Control_TextDirection>` **text_direction** = ``0`` :ref:`🔗<class_LineEdit_property_text_direction>`
  651. .. rst-class:: classref-property-setget
  652. - |void| **set_text_direction**\ (\ value\: :ref:`TextDirection<enum_Control_TextDirection>`\ )
  653. - :ref:`TextDirection<enum_Control_TextDirection>` **get_text_direction**\ (\ )
  654. Base text writing direction.
  655. .. rst-class:: classref-item-separator
  656. ----
  657. .. _class_LineEdit_property_virtual_keyboard_enabled:
  658. .. rst-class:: classref-property
  659. :ref:`bool<class_bool>` **virtual_keyboard_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_virtual_keyboard_enabled>`
  660. .. rst-class:: classref-property-setget
  661. - |void| **set_virtual_keyboard_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  662. - :ref:`bool<class_bool>` **is_virtual_keyboard_enabled**\ (\ )
  663. If ``true``, the native virtual keyboard is shown when focused on platforms that support it.
  664. .. rst-class:: classref-item-separator
  665. ----
  666. .. _class_LineEdit_property_virtual_keyboard_type:
  667. .. rst-class:: classref-property
  668. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **virtual_keyboard_type** = ``0`` :ref:`🔗<class_LineEdit_property_virtual_keyboard_type>`
  669. .. rst-class:: classref-property-setget
  670. - |void| **set_virtual_keyboard_type**\ (\ value\: :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>`\ )
  671. - :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **get_virtual_keyboard_type**\ (\ )
  672. Specifies the type of virtual keyboard to show.
  673. .. rst-class:: classref-section-separator
  674. ----
  675. .. rst-class:: classref-descriptions-group
  676. Method Descriptions
  677. -------------------
  678. .. _class_LineEdit_method_clear:
  679. .. rst-class:: classref-method
  680. |void| **clear**\ (\ ) :ref:`🔗<class_LineEdit_method_clear>`
  681. Erases the **LineEdit**'s :ref:`text<class_LineEdit_property_text>`.
  682. .. rst-class:: classref-item-separator
  683. ----
  684. .. _class_LineEdit_method_delete_char_at_caret:
  685. .. rst-class:: classref-method
  686. |void| **delete_char_at_caret**\ (\ ) :ref:`🔗<class_LineEdit_method_delete_char_at_caret>`
  687. Deletes one character at the caret's current position (equivalent to pressing :kbd:`Delete`).
  688. .. rst-class:: classref-item-separator
  689. ----
  690. .. _class_LineEdit_method_delete_text:
  691. .. rst-class:: classref-method
  692. |void| **delete_text**\ (\ from_column\: :ref:`int<class_int>`, to_column\: :ref:`int<class_int>`\ ) :ref:`🔗<class_LineEdit_method_delete_text>`
  693. Deletes a section of the :ref:`text<class_LineEdit_property_text>` going from position ``from_column`` to ``to_column``. Both parameters should be within the text's length.
  694. .. rst-class:: classref-item-separator
  695. ----
  696. .. _class_LineEdit_method_deselect:
  697. .. rst-class:: classref-method
  698. |void| **deselect**\ (\ ) :ref:`🔗<class_LineEdit_method_deselect>`
  699. Clears the current selection.
  700. .. rst-class:: classref-item-separator
  701. ----
  702. .. _class_LineEdit_method_get_menu:
  703. .. rst-class:: classref-method
  704. :ref:`PopupMenu<class_PopupMenu>` **get_menu**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_get_menu>`
  705. Returns the :ref:`PopupMenu<class_PopupMenu>` of this **LineEdit**. By default, this menu is displayed when right-clicking on the **LineEdit**.
  706. You can add custom menu items or remove standard ones. Make sure your IDs don't conflict with the standard ones (see :ref:`MenuItems<enum_LineEdit_MenuItems>`). For example:
  707. .. tabs::
  708. .. code-tab:: gdscript
  709. func _ready():
  710. var menu = get_menu()
  711. # Remove all items after "Redo".
  712. menu.item_count = menu.get_item_index(MENU_REDO) + 1
  713. # Add custom items.
  714. menu.add_separator()
  715. menu.add_item("Insert Date", MENU_MAX + 1)
  716. # Connect callback.
  717. menu.id_pressed.connect(_on_item_pressed)
  718. func _on_item_pressed(id):
  719. if id == MENU_MAX + 1:
  720. insert_text_at_caret(Time.get_date_string_from_system())
  721. .. code-tab:: csharp
  722. public override void _Ready()
  723. {
  724. var menu = GetMenu();
  725. // Remove all items after "Redo".
  726. menu.ItemCount = menu.GetItemIndex(LineEdit.MenuItems.Redo) + 1;
  727. // Add custom items.
  728. menu.AddSeparator();
  729. menu.AddItem("Insert Date", LineEdit.MenuItems.Max + 1);
  730. // Add event handler.
  731. menu.IdPressed += OnItemPressed;
  732. }
  733. public void OnItemPressed(int id)
  734. {
  735. if (id == LineEdit.MenuItems.Max + 1)
  736. {
  737. InsertTextAtCaret(Time.GetDateStringFromSystem());
  738. }
  739. }
  740. \ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`Window.visible<class_Window_property_visible>` property.
  741. .. rst-class:: classref-item-separator
  742. ----
  743. .. _class_LineEdit_method_get_scroll_offset:
  744. .. rst-class:: classref-method
  745. :ref:`float<class_float>` **get_scroll_offset**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_get_scroll_offset>`
  746. Returns the scroll offset due to :ref:`caret_column<class_LineEdit_property_caret_column>`, as a number of characters.
  747. .. rst-class:: classref-item-separator
  748. ----
  749. .. _class_LineEdit_method_get_selected_text:
  750. .. rst-class:: classref-method
  751. :ref:`String<class_String>` **get_selected_text**\ (\ ) :ref:`🔗<class_LineEdit_method_get_selected_text>`
  752. Returns the text inside the selection.
  753. .. rst-class:: classref-item-separator
  754. ----
  755. .. _class_LineEdit_method_get_selection_from_column:
  756. .. rst-class:: classref-method
  757. :ref:`int<class_int>` **get_selection_from_column**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_get_selection_from_column>`
  758. Returns the selection begin column.
  759. .. rst-class:: classref-item-separator
  760. ----
  761. .. _class_LineEdit_method_get_selection_to_column:
  762. .. rst-class:: classref-method
  763. :ref:`int<class_int>` **get_selection_to_column**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_get_selection_to_column>`
  764. Returns the selection end column.
  765. .. rst-class:: classref-item-separator
  766. ----
  767. .. _class_LineEdit_method_has_selection:
  768. .. rst-class:: classref-method
  769. :ref:`bool<class_bool>` **has_selection**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_has_selection>`
  770. Returns ``true`` if the user has selected text.
  771. .. rst-class:: classref-item-separator
  772. ----
  773. .. _class_LineEdit_method_insert_text_at_caret:
  774. .. rst-class:: classref-method
  775. |void| **insert_text_at_caret**\ (\ text\: :ref:`String<class_String>`\ ) :ref:`🔗<class_LineEdit_method_insert_text_at_caret>`
  776. Inserts ``text`` at the caret. If the resulting value is longer than :ref:`max_length<class_LineEdit_property_max_length>`, nothing happens.
  777. .. rst-class:: classref-item-separator
  778. ----
  779. .. _class_LineEdit_method_is_menu_visible:
  780. .. rst-class:: classref-method
  781. :ref:`bool<class_bool>` **is_menu_visible**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_is_menu_visible>`
  782. Returns whether the menu is visible. Use this instead of ``get_menu().visible`` to improve performance (so the creation of the menu is avoided).
  783. .. rst-class:: classref-item-separator
  784. ----
  785. .. _class_LineEdit_method_menu_option:
  786. .. rst-class:: classref-method
  787. |void| **menu_option**\ (\ option\: :ref:`int<class_int>`\ ) :ref:`🔗<class_LineEdit_method_menu_option>`
  788. Executes a given action as defined in the :ref:`MenuItems<enum_LineEdit_MenuItems>` enum.
  789. .. rst-class:: classref-item-separator
  790. ----
  791. .. _class_LineEdit_method_select:
  792. .. rst-class:: classref-method
  793. |void| **select**\ (\ from\: :ref:`int<class_int>` = 0, to\: :ref:`int<class_int>` = -1\ ) :ref:`🔗<class_LineEdit_method_select>`
  794. Selects characters inside **LineEdit** between ``from`` and ``to``. By default, ``from`` is at the beginning and ``to`` at the end.
  795. .. tabs::
  796. .. code-tab:: gdscript
  797. text = "Welcome"
  798. select() # Will select "Welcome".
  799. select(4) # Will select "ome".
  800. select(2, 5) # Will select "lco".
  801. .. code-tab:: csharp
  802. Text = "Welcome";
  803. Select(); // Will select "Welcome".
  804. Select(4); // Will select "ome".
  805. Select(2, 5); // Will select "lco".
  806. .. rst-class:: classref-item-separator
  807. ----
  808. .. _class_LineEdit_method_select_all:
  809. .. rst-class:: classref-method
  810. |void| **select_all**\ (\ ) :ref:`🔗<class_LineEdit_method_select_all>`
  811. Selects the whole :ref:`String<class_String>`.
  812. .. rst-class:: classref-section-separator
  813. ----
  814. .. rst-class:: classref-descriptions-group
  815. Theme Property Descriptions
  816. ---------------------------
  817. .. _class_LineEdit_theme_color_caret_color:
  818. .. rst-class:: classref-themeproperty
  819. :ref:`Color<class_Color>` **caret_color** = ``Color(0.95, 0.95, 0.95, 1)`` :ref:`🔗<class_LineEdit_theme_color_caret_color>`
  820. Color of the **LineEdit**'s caret (text cursor). This can be set to a fully transparent color to hide the caret entirely.
  821. .. rst-class:: classref-item-separator
  822. ----
  823. .. _class_LineEdit_theme_color_clear_button_color:
  824. .. rst-class:: classref-themeproperty
  825. :ref:`Color<class_Color>` **clear_button_color** = ``Color(0.875, 0.875, 0.875, 1)`` :ref:`🔗<class_LineEdit_theme_color_clear_button_color>`
  826. Color used as default tint for the clear button.
  827. .. rst-class:: classref-item-separator
  828. ----
  829. .. _class_LineEdit_theme_color_clear_button_color_pressed:
  830. .. rst-class:: classref-themeproperty
  831. :ref:`Color<class_Color>` **clear_button_color_pressed** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_LineEdit_theme_color_clear_button_color_pressed>`
  832. Color used for the clear button when it's pressed.
  833. .. rst-class:: classref-item-separator
  834. ----
  835. .. _class_LineEdit_theme_color_font_color:
  836. .. rst-class:: classref-themeproperty
  837. :ref:`Color<class_Color>` **font_color** = ``Color(0.875, 0.875, 0.875, 1)`` :ref:`🔗<class_LineEdit_theme_color_font_color>`
  838. Default font color.
  839. .. rst-class:: classref-item-separator
  840. ----
  841. .. _class_LineEdit_theme_color_font_outline_color:
  842. .. rst-class:: classref-themeproperty
  843. :ref:`Color<class_Color>` **font_outline_color** = ``Color(0, 0, 0, 1)`` :ref:`🔗<class_LineEdit_theme_color_font_outline_color>`
  844. The tint of text outline of the **LineEdit**.
  845. .. rst-class:: classref-item-separator
  846. ----
  847. .. _class_LineEdit_theme_color_font_placeholder_color:
  848. .. rst-class:: classref-themeproperty
  849. :ref:`Color<class_Color>` **font_placeholder_color** = ``Color(0.875, 0.875, 0.875, 0.6)`` :ref:`🔗<class_LineEdit_theme_color_font_placeholder_color>`
  850. Font color for :ref:`placeholder_text<class_LineEdit_property_placeholder_text>`.
  851. .. rst-class:: classref-item-separator
  852. ----
  853. .. _class_LineEdit_theme_color_font_selected_color:
  854. .. rst-class:: classref-themeproperty
  855. :ref:`Color<class_Color>` **font_selected_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_LineEdit_theme_color_font_selected_color>`
  856. Font color for selected text (inside the selection rectangle).
  857. .. rst-class:: classref-item-separator
  858. ----
  859. .. _class_LineEdit_theme_color_font_uneditable_color:
  860. .. rst-class:: classref-themeproperty
  861. :ref:`Color<class_Color>` **font_uneditable_color** = ``Color(0.875, 0.875, 0.875, 0.5)`` :ref:`🔗<class_LineEdit_theme_color_font_uneditable_color>`
  862. Font color when editing is disabled.
  863. .. rst-class:: classref-item-separator
  864. ----
  865. .. _class_LineEdit_theme_color_selection_color:
  866. .. rst-class:: classref-themeproperty
  867. :ref:`Color<class_Color>` **selection_color** = ``Color(0.5, 0.5, 0.5, 1)`` :ref:`🔗<class_LineEdit_theme_color_selection_color>`
  868. Color of the selection rectangle.
  869. .. rst-class:: classref-item-separator
  870. ----
  871. .. _class_LineEdit_theme_constant_caret_width:
  872. .. rst-class:: classref-themeproperty
  873. :ref:`int<class_int>` **caret_width** = ``1`` :ref:`🔗<class_LineEdit_theme_constant_caret_width>`
  874. The caret's width in pixels. Greater values can be used to improve accessibility by ensuring the caret is easily visible, or to ensure consistency with a large font size.
  875. .. rst-class:: classref-item-separator
  876. ----
  877. .. _class_LineEdit_theme_constant_minimum_character_width:
  878. .. rst-class:: classref-themeproperty
  879. :ref:`int<class_int>` **minimum_character_width** = ``4`` :ref:`🔗<class_LineEdit_theme_constant_minimum_character_width>`
  880. 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 number of 'M' characters can be displayed without scrolling).
  881. .. rst-class:: classref-item-separator
  882. ----
  883. .. _class_LineEdit_theme_constant_outline_size:
  884. .. rst-class:: classref-themeproperty
  885. :ref:`int<class_int>` **outline_size** = ``0`` :ref:`🔗<class_LineEdit_theme_constant_outline_size>`
  886. The size of the text outline.
  887. \ **Note:** If using a font with :ref:`FontFile.multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` enabled, its :ref:`FontFile.msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` must be set to at least *twice* the value of :ref:`outline_size<class_LineEdit_theme_constant_outline_size>` for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
  888. .. rst-class:: classref-item-separator
  889. ----
  890. .. _class_LineEdit_theme_font_font:
  891. .. rst-class:: classref-themeproperty
  892. :ref:`Font<class_Font>` **font** :ref:`🔗<class_LineEdit_theme_font_font>`
  893. Font used for the text.
  894. .. rst-class:: classref-item-separator
  895. ----
  896. .. _class_LineEdit_theme_font_size_font_size:
  897. .. rst-class:: classref-themeproperty
  898. :ref:`int<class_int>` **font_size** :ref:`🔗<class_LineEdit_theme_font_size_font_size>`
  899. Font size of the **LineEdit**'s text.
  900. .. rst-class:: classref-item-separator
  901. ----
  902. .. _class_LineEdit_theme_icon_clear:
  903. .. rst-class:: classref-themeproperty
  904. :ref:`Texture2D<class_Texture2D>` **clear** :ref:`🔗<class_LineEdit_theme_icon_clear>`
  905. Texture for the clear button. See :ref:`clear_button_enabled<class_LineEdit_property_clear_button_enabled>`.
  906. .. rst-class:: classref-item-separator
  907. ----
  908. .. _class_LineEdit_theme_style_focus:
  909. .. rst-class:: classref-themeproperty
  910. :ref:`StyleBox<class_StyleBox>` **focus** :ref:`🔗<class_LineEdit_theme_style_focus>`
  911. Background used when **LineEdit** has GUI focus. The :ref:`focus<class_LineEdit_theme_style_focus>` :ref:`StyleBox<class_StyleBox>` is displayed *over* the base :ref:`StyleBox<class_StyleBox>`, so a partially transparent :ref:`StyleBox<class_StyleBox>` should be used to ensure the base :ref:`StyleBox<class_StyleBox>` remains visible. A :ref:`StyleBox<class_StyleBox>` that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a :ref:`StyleBoxEmpty<class_StyleBoxEmpty>` resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.
  912. .. rst-class:: classref-item-separator
  913. ----
  914. .. _class_LineEdit_theme_style_normal:
  915. .. rst-class:: classref-themeproperty
  916. :ref:`StyleBox<class_StyleBox>` **normal** :ref:`🔗<class_LineEdit_theme_style_normal>`
  917. Default background for the **LineEdit**.
  918. .. rst-class:: classref-item-separator
  919. ----
  920. .. _class_LineEdit_theme_style_read_only:
  921. .. rst-class:: classref-themeproperty
  922. :ref:`StyleBox<class_StyleBox>` **read_only** :ref:`🔗<class_LineEdit_theme_style_read_only>`
  923. Background used when **LineEdit** is in read-only mode (:ref:`editable<class_LineEdit_property_editable>` is set to ``false``).
  924. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  925. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  926. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  927. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  928. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  929. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  930. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  931. .. |void| replace:: :abbr:`void (No return value.)`