mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-25 14:17:29 -04:00
help button, scroll with prompt
This commit is contained in:
parent
00fa349440
commit
647b0ca20c
6 changed files with 142 additions and 15 deletions
|
@ -1,13 +1,30 @@
|
|||
extends Control
|
||||
|
||||
@export var search_le: LineEdit
|
||||
@export var search: Search
|
||||
|
||||
var update_position: bool
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
search_le.resized.connect(change_size)
|
||||
search_le.focus_entered.connect(change_size)
|
||||
search.resized.connect(change_size)
|
||||
search.focus_entered.connect(change_size)
|
||||
|
||||
|
||||
func change_size() -> void:
|
||||
global_position = get_parent().global_position
|
||||
size.x = search_le.size.x
|
||||
size.x = search.size.x
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if not search.has_focus(): return
|
||||
|
||||
if (event is InputEventMouseButton
|
||||
and event.button_index in [MOUSE_BUTTON_WHEEL_UP, MOUSE_BUTTON_WHEEL_DOWN]):
|
||||
update_position = true
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if not update_position: return
|
||||
|
||||
global_position = get_parent().global_position
|
||||
update_position = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue