boronotes/components/note_item/note_item.gd

22 lines
329 B
GDScript

class_name NoteItem
extends PanelContainer
signal pressed(note: Note)
@export var note: Note :
set(new_note):
if note != new_note:
note = new_note
if button:
button.text = note.title
@onready var button: Button = %Button
func _ready():
button.text = note.title
func _on_button_pressed():
pressed.emit(note)