Bugbot/UI/bug_info.gd

38 lines
1.1 KiB
GDScript

class_name BugbotBugInfoDialogue
extends Control
@onready var __bug_info_title_label : Label = $VBoxContainer/Title
@onready var __bug_info_severity_label : Label = $VBoxContainer/Severity
@onready var __bug_info_status_label : Label = $VBoxContainer/Status
@onready var __close_button : Button = $VBoxContainer/Buttons/Close
var bug_info : BugbotBugData = null : set = __set_bug_info
var stored_mouse_mode : Input.MouseMode
func _enter_tree() -> void:
stored_mouse_mode = Input.mouse_mode
Input.mouse_mode = Input.MouseMode.MOUSE_MODE_VISIBLE
func _ready() -> void:
__close_button.grab_focus()
func _exit_tree() -> void:
Input.mouse_mode = stored_mouse_mode
func __set_bug_info(info:BugbotBugData) -> void:
bug_info = info
__bug_info_title_label.text = bug_info.title
__bug_info_severity_label.text = bug_info.severity
__bug_info_status_label.text = bug_info.status
func _on_open_in_browser_pressed() -> void:
OS.shell_open(BugbotServerAPI._create_new_server_api()._get_bug_url(bug_info))
queue_free()
func _on_close_pressed() -> void:
queue_free()