Add button click and checkbox toggle handlers for UI controls

This commit is contained in:
Stone_Red
2026-06-13 15:06:29 +02:00
parent 0bc9ca6cf2
commit decd79e6d3
5 changed files with 36 additions and 14 deletions
+5 -2
View File
@@ -18,8 +18,11 @@ public class Button() : Control("Button")
set => SetProperty(nameof(TextColor), ref field, value);
} = Color.Black;
public void Click()
public override void HandleMouseEvent(MouseEvent mouseEvent)
{
OnClick?.Invoke(this, EventArgs.Empty);
if (mouseEvent.Type == MouseEventType.ButtonDown && mouseEvent.Button == MouseButton.Left)
{
OnClick?.Invoke(this, EventArgs.Empty);
}
}
}