system-selection.cpp 445 B

12345678910111213141516171819
  1. SystemSelection::SystemSelection(View* view) : Panel(view, Size{155_sx, ~0}) {
  2. setCollapsible().setVisible(false);
  3. for(auto& medium : media) {
  4. ListViewItem item{&systemList};
  5. item.setText(medium->name());
  6. }
  7. systemList.onChange([&] { eventChange(); });
  8. }
  9. auto SystemSelection::eventChange() -> void {
  10. if(auto item = systemList.selected()) {
  11. gameManager.select(item.text());
  12. } else {
  13. programWindow.show(home);
  14. }
  15. }