input (radio/password), max/min length, pattern

This commit is contained in:
Face
2025-07-23 18:09:16 +03:00
parent a9ce6cb178
commit a899f3637e
15 changed files with 376 additions and 105 deletions

View File

@@ -1,9 +1,13 @@
[gd_resource type="Theme" load_steps=17 format=3 uid="uid://bn6rbmdy60lhr"]
[gd_resource type="Theme" load_steps=21 format=3 uid="uid://bn6rbmdy60lhr"]
[ext_resource type="Texture2D" uid="uid://dn4dxn8hkrd64" path="res://Assets/Icons/checkbox.svg" id="1_75mhk"]
[ext_resource type="Texture2D" uid="uid://b6ucuyluuw43" path="res://Assets/Icons/checkbox_pressed_grayscale.svg" id="2_2abar"]
[ext_resource type="Texture2D" uid="uid://c5scqw224r2e5" path="res://Assets/Icons/checkbox_pressed.svg" id="2_3k2jb"]
[ext_resource type="Texture2D" uid="uid://b2v8ee23580c3" path="res://Assets/Icons/radio.svg" id="3_3weog"]
[ext_resource type="Texture2D" uid="uid://bap17ryrkcyey" path="res://Assets/Icons/checkbox_disabled.svg" id="4_c32on"]
[ext_resource type="Texture2D" uid="uid://y1xqfcd8ro5t" path="res://Assets/Icons/radio_checked_grayscale.svg" id="4_n77xs"]
[ext_resource type="Texture2D" uid="uid://bj7bpovnm25ml" path="res://Assets/Icons/radio_checked.svg" id="4_sesrd"]
[ext_resource type="Texture2D" uid="uid://bs414mrvwdmcn" path="res://Assets/Icons/radio_disabled.svg" id="6_r011l"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_c32on"]
@@ -77,6 +81,10 @@ Button/styles/hover = SubResource("StyleBoxFlat_7g0pl")
Button/styles/normal = SubResource("StyleBoxFlat_c32on")
CheckBox/icons/checked = ExtResource("2_3k2jb")
CheckBox/icons/checked_disabled = ExtResource("2_2abar")
CheckBox/icons/radio_checked = ExtResource("4_sesrd")
CheckBox/icons/radio_checked_disabled = ExtResource("4_n77xs")
CheckBox/icons/radio_unchecked = ExtResource("3_3weog")
CheckBox/icons/radio_unchecked_disabled = ExtResource("6_r011l")
CheckBox/icons/unchecked = ExtResource("1_75mhk")
CheckBox/icons/unchecked_disabled = ExtResource("4_c32on")
CheckBox/styles/focus = SubResource("StyleBoxEmpty_75mhk")

View File

@@ -1,7 +1,8 @@
[gd_scene load_steps=3 format=3 uid="uid://c7yay102a3b4c"]
[gd_scene load_steps=4 format=3 uid="uid://c7yay102a3b4c"]
[ext_resource type="Script" uid="uid://kv6ebscarj2e" path="res://Scripts/Tags/input.gd" id="1_input"]
[ext_resource type="Theme" uid="uid://bn6rbmdy60lhr" path="res://Scenes/Styles/BrowserText.tres" id="2_theme"]
[ext_resource type="ButtonGroup" uid="uid://dgvdef1uht5ht" path="res://Scenes/Tags/new_button_group.tres" id="3_a88g6"]
[node name="Input" type="Control"]
layout_mode = 3
@@ -21,6 +22,7 @@ layout_mode = 1
offset_right = 400.0
offset_bottom = 35.0
theme = ExtResource("2_theme")
text = "test"
placeholder_text = "Enter text..."
caret_blink = true
@@ -32,3 +34,13 @@ offset_bottom = 31.0
theme = ExtResource("2_theme")
theme_override_constants/icon_max_width = 24
flat = true
[node name="RadioButton" type="CheckBox" parent="."]
visible = false
layout_mode = 0
offset_right = 31.0
offset_bottom = 31.0
theme = ExtResource("2_theme")
theme_override_constants/icon_max_width = 24
button_group = ExtResource("3_a88g6")
flat = true

View File

@@ -0,0 +1,45 @@
[gd_scene load_steps=4 format=3 uid="uid://c7yay102a3b4c"]
[ext_resource type="Script" uid="uid://kv6ebscarj2e" path="res://Scripts/Tags/input.gd" id="1_input"]
[ext_resource type="Theme" uid="uid://bn6rbmdy60lhr" path="res://Scenes/Styles/BrowserText.tres" id="2_theme"]
[ext_resource type="ButtonGroup" uid="uid://dgvdef1uht5ht" path="res://Scenes/Tags/new_button_group.tres" id="3_a88g6"]
[node name="Input" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = 400.0
offset_bottom = 31.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 0
script = ExtResource("1_input")
[node name="LineEdit" type="LineEdit" parent="."]
visible = false
layout_mode = 1
offset_right = 400.0
offset_bottom = 35.0
theme = ExtResource("2_theme")
placeholder_text = "Enter text..."
caret_blink = true
[node name="CheckBox" type="CheckBox" parent="."]
visible = false
layout_mode = 0
offset_right = 31.0
offset_bottom = 31.0
theme = ExtResource("2_theme")
theme_override_constants/icon_max_width = 24
flat = true
[node name="RadioButton" type="CheckBox" parent="."]
layout_mode = 0
offset_right = 31.0
offset_bottom = 31.0
theme = ExtResource("2_theme")
theme_override_constants/icon_max_width = 24
button_group = ExtResource("3_a88g6")
flat = true

View File

@@ -0,0 +1,3 @@
[gd_resource type="ButtonGroup" format=3 uid="uid://dgvdef1uht5ht"]
[resource]