handlePaintModeChanged method
Handles the paint mode change event.
This method calls the onPaintModeChanged callback with the provided newMode
and then calls handleUpdateUI.
Implementation
void handlePaintModeChanged(PaintModeE newMode) {
onPaintModeChanged?.call(newMode);
handleUpdateUI();
}