Implement state for focused and selected

dmytrodanylyk#17