Closed JakobDev closed 2 years ago
Wouldn't code like this work better and make more sense? As-in just don't show the popup when there's nothing selected.
void RomBrowserWidget::customContextMenuRequested(QPoint position)
{
if (this->selectedIndexes().count() > 0)
{
this->contextMenu->popup(this->viewport()->mapToGlobal(position));
}
}
The context menu contains 2 Actions (Refresh and choose ROM Directory) which doesn't depends on a selected Game.
Showing a context menu with disabled Actions, is what most programs do, so it's the behavior that a User expects.
Fair, if you fix my nitpick, I'll merge it, thank you ❤️
Thank you :heart:
If no ROM is selected, the Actions that refer to a selected ROM are disabled now. This also fixes a Crash when Play Game is clicked without a ROM selected.