mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-25 05:17:25 -04:00
search bar redesign, remove old icons
This commit is contained in:
parent
02aa9514ab
commit
6a9bb0885b
65 changed files with 290 additions and 1049 deletions
|
@ -1,8 +1,8 @@
|
|||
extends TextureRect
|
||||
|
||||
@export var duration: float
|
||||
@export var start_scale: float
|
||||
@export var end_scale: float
|
||||
@export var duration: float
|
||||
|
||||
@onready var start := Vector2(start_scale, start_scale)
|
||||
@onready var end := Vector2(end_scale, end_scale)
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
extends Control
|
||||
|
||||
@export var search_le: LineEdit
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
await get_tree().process_frame
|
||||
search_le.resized.connect(change_size)
|
||||
|
||||
|
||||
func change_size() -> void:
|
||||
global_position = get_parent().global_position
|
||||
size.x = search_le.size.x
|
||||
|
|
|
@ -9,6 +9,7 @@ class_name PromptResults
|
|||
|
||||
var prompt_size: float
|
||||
var result_str: String
|
||||
var last_query: String
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
|
@ -21,9 +22,11 @@ func _ready() -> void:
|
|||
|
||||
|
||||
func _on_search_text_changed(query: String) -> void:
|
||||
last_query = query
|
||||
if query.is_empty(): clear(); return
|
||||
|
||||
await prompt_request(query)
|
||||
if query != last_query: return
|
||||
clear()
|
||||
|
||||
var prompts = JSON.parse_string(result_str)
|
||||
|
|
|
@ -8,6 +8,9 @@ extends Control
|
|||
@export var success: Control
|
||||
@export var error: Control
|
||||
|
||||
@export var white: Color
|
||||
@export var gray: Color
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
search_line_edit.text_changed.connect(func(_text): switch_to(search))
|
||||
|
@ -24,6 +27,11 @@ func switch_to(_state: Control) -> void:
|
|||
disable([search, downloading, success, error])
|
||||
_state.visible = true
|
||||
_state.process_mode = Node.PROCESS_MODE_INHERIT
|
||||
change_color.call_deferred()
|
||||
|
||||
|
||||
func change_color() -> void:
|
||||
modulate = gray if search_line_edit.text.is_empty() else white
|
||||
|
||||
|
||||
func disable(states: Array[Control]) -> void:
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
extends BaseButton
|
||||
|
||||
@export var gate_events: GateEvents
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
visible = false
|
||||
|
||||
|
||||
func _on_search_text_changed(_url: String) -> void:
|
||||
#visible = true if not _url.is_empty() else false
|
||||
pass
|
Loading…
Add table
Add a link
Reference in a new issue