mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-23 08:17:34 -04:00
fix navigation with search
This commit is contained in:
parent
985f252430
commit
2bd62d2564
2 changed files with 11 additions and 3 deletions
|
@ -33,7 +33,7 @@ func on_go_back() -> void:
|
||||||
|
|
||||||
enable([go_forw])
|
enable([go_forw])
|
||||||
if history.can_back():
|
if history.can_back():
|
||||||
gate_events.open_gate_emit(location)
|
open(location)
|
||||||
else:
|
else:
|
||||||
disable([go_back, reload, home])
|
disable([go_back, reload, home])
|
||||||
gate_events.exit_gate_emit()
|
gate_events.exit_gate_emit()
|
||||||
|
@ -46,11 +46,11 @@ func on_go_forw() -> void:
|
||||||
if not history.can_forw():
|
if not history.can_forw():
|
||||||
disable([go_forw])
|
disable([go_forw])
|
||||||
|
|
||||||
gate_events.open_gate_emit(location)
|
open(location)
|
||||||
|
|
||||||
|
|
||||||
func on_reload() -> void:
|
func on_reload() -> void:
|
||||||
gate_events.open_gate_emit(history.get_current())
|
open(history.get_current())
|
||||||
|
|
||||||
|
|
||||||
func on_home() -> void:
|
func on_home() -> void:
|
||||||
|
@ -59,6 +59,13 @@ func on_home() -> void:
|
||||||
gate_events.exit_gate_emit()
|
gate_events.exit_gate_emit()
|
||||||
|
|
||||||
|
|
||||||
|
func open(location: String) -> void:
|
||||||
|
if Url.is_valid(location):
|
||||||
|
gate_events.open_gate_emit(location)
|
||||||
|
else:
|
||||||
|
gate_events.search_emit(location)
|
||||||
|
|
||||||
|
|
||||||
func disable(buttons: Array[BaseButton]) -> void:
|
func disable(buttons: Array[BaseButton]) -> void:
|
||||||
for button in buttons:
|
for button in buttons:
|
||||||
button.disabled = true
|
button.disabled = true
|
||||||
|
|
|
@ -7,6 +7,7 @@ var url: String
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
gate_events.open_gate.connect(set_current_url)
|
gate_events.open_gate.connect(set_current_url)
|
||||||
|
gate_events.search.connect(set_current_url)
|
||||||
gate_events.exit_gate.connect(set_current_url.bind(""))
|
gate_events.exit_gate.connect(set_current_url.bind(""))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue