#14,#15,#29,#31: Added qr, added more settings, added keymap, changed about page.
Build / build (push) Successful in 1m10s
Build / build (push) Successful in 1m10s
This commit is contained in:
+42
@@ -0,0 +1,42 @@
|
||||
extends Control
|
||||
|
||||
@onready
|
||||
var qr_panel: Panel = $QRPanel
|
||||
|
||||
@onready
|
||||
var qr_code_rect: QRCodeRect = $QRPanel/QRCodeRect
|
||||
|
||||
@onready
|
||||
var url_label: Label = $QRPanel/URLLabel
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
qr_code_rect.light_module_color = Color.WHITE
|
||||
qr_code_rect.dark_module_color = Color.BLACK
|
||||
qr_code_rect.quiet_zone_size = 4
|
||||
|
||||
# Generate QR code for the search URL
|
||||
var url: String = Settings.default_path + "/search"
|
||||
qr_code_rect.data = url
|
||||
url_label.text = qr_code_rect.data
|
||||
print("QR code generated for: ", url)
|
||||
|
||||
|
||||
func show_window() -> void:
|
||||
visible = true
|
||||
# Regenerate QR code in case settings changed
|
||||
var url: String = Settings.default_path + "/search"
|
||||
qr_code_rect.data = url
|
||||
url_label.text = qr_code_rect.data
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if self.visible == true:
|
||||
if event is InputEventMouseButton && event.is_pressed():
|
||||
var evLocal: InputEvent = make_input_local(event)
|
||||
if !Rect2(Vector2(0, 0), qr_panel.size).has_point(evLocal.position):
|
||||
self.visible = false
|
||||
|
||||
|
||||
func hide_window() -> void:
|
||||
visible = false
|
||||
Reference in New Issue
Block a user