Add synced user notes
This commit is contained in:
@@ -83,6 +83,7 @@ var labs_button: Button
|
||||
var clear_highlight_button: Button
|
||||
var flag_button: Button
|
||||
var report_button: Button
|
||||
var notes_button: Button
|
||||
var app_feedback_button: Button
|
||||
var theme_button: Button
|
||||
var question_toolbar: HFlowContainer
|
||||
@@ -273,6 +274,18 @@ func _ready() -> void:
|
||||
report_button.pressed.connect(_toggle_report_current_question)
|
||||
question_toolbar.add_child(report_button)
|
||||
|
||||
notes_button = Button.new()
|
||||
notes_button.tooltip_text = "Open notes"
|
||||
notes_button.icon = preload("res://assets/icons/lucide/notebook-pen.svg")
|
||||
notes_button.custom_minimum_size = Vector2(44, 44)
|
||||
notes_button.add_theme_constant_override("icon_max_width", 22)
|
||||
notes_button.alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
notes_button.icon_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
notes_button.focus_mode = Control.FOCUS_NONE
|
||||
UISoundService.set_button_sound(notes_button, "open")
|
||||
notes_button.pressed.connect(func(): main.open_notes_dialog())
|
||||
question_toolbar.add_child(notes_button)
|
||||
|
||||
app_feedback_button = Button.new()
|
||||
app_feedback_button.text = "Feedback"
|
||||
app_feedback_button.tooltip_text = "Send general feedback or report a bug"
|
||||
@@ -827,7 +840,7 @@ func _apply_question_theme() -> void:
|
||||
var navigator_heading := navigator_popup.find_child("NavigatorHeading", true, false) as Label
|
||||
if navigator_heading != null:
|
||||
navigator_heading.add_theme_color_override("font_color", Brand.text_color(dark))
|
||||
for control in [text_smaller_button, text_larger_button, flag_button, app_feedback_button]:
|
||||
for control in [text_smaller_button, text_larger_button, flag_button, notes_button, app_feedback_button]:
|
||||
if control == null:
|
||||
continue
|
||||
var active: bool = control == flag_button and flagged
|
||||
@@ -1864,6 +1877,8 @@ func _refresh_toolbar_state() -> void:
|
||||
if report_button != null:
|
||||
var question_id := str(BlockSessionService.get_current_question().get("id", ""))
|
||||
report_button.tooltip_text = "Report submitted; report another issue" if reported_question_ids.has(question_id) else "Report question"
|
||||
if notes_button != null:
|
||||
notes_button.visible = BlockSessionService.session_kind != "simulation"
|
||||
_apply_question_theme()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user