|
@@ -91,6 +91,9 @@ func display_items(filter: String):
|
|
|
else:
|
|
else:
|
|
|
self.size.y = min(item_container.size.y + search_bar.size.y + 12, 410)
|
|
self.size.y = min(item_container.size.y + search_bar.size.y + 12, 410)
|
|
|
|
|
|
|
|
|
|
+ #highlight first button
|
|
|
|
|
+ _on_search_bar_editing_toggled(true)
|
|
|
|
|
+
|
|
|
func _on_search_bar_text_changed(new_text: String) -> void:
|
|
func _on_search_bar_text_changed(new_text: String) -> void:
|
|
|
display_items(new_text)
|
|
display_items(new_text)
|
|
|
|
|
|
|
@@ -102,3 +105,19 @@ func _on_search_bar_text_submitted(new_text: String) -> void:
|
|
|
var button = item_container.get_child(0)
|
|
var button = item_container.get_child(0)
|
|
|
if button and button is Button:
|
|
if button and button is Button:
|
|
|
button.emit_signal("pressed")
|
|
button.emit_signal("pressed")
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+func _on_search_bar_editing_toggled(toggled_on: bool) -> void:
|
|
|
|
|
+ #highlight first button when editing is toggled
|
|
|
|
|
+ var button = item_container.get_child(0)
|
|
|
|
|
+ if toggled_on:
|
|
|
|
|
+ if button and button is Button:
|
|
|
|
|
+ var base_stylebox = button.get_theme_stylebox("normal", "Button")
|
|
|
|
|
+ var new_stylebox = base_stylebox.duplicate()
|
|
|
|
|
+ new_stylebox.bg_color = Color.hex(0xffffff6a)
|
|
|
|
|
+ button.add_theme_stylebox_override("normal", new_stylebox)
|
|
|
|
|
+ #skip this button on tab navigation
|
|
|
|
|
+ button.focus_mode = Control.FOCUS_CLICK
|
|
|
|
|
+ else:
|
|
|
|
|
+ if button and button is Button:
|
|
|
|
|
+ button.remove_theme_stylebox_override("normal")
|