qt: fix grid

This commit is contained in:
DanielSvoboda 2025-01-26 17:38:39 -03:00
parent 461148c227
commit 1bc504f863

View File

@ -43,12 +43,17 @@ void GameGridFrame::onCurrentCellChanged(int currentRow, int currentColumn, int
columnCnt = this->columnCount(); columnCnt = this->columnCount();
auto itemID = (crtRow * columnCnt) + currentColumn; auto itemID = (crtRow * columnCnt) + currentColumn;
static QString originalStyle = this->styleSheet();
if (itemID > m_game_info->m_games.count() - 1) { if (itemID > m_game_info->m_games.count() - 1) {
cellClicked = false; cellClicked = false;
validCellSelected = false; validCellSelected = false;
BackgroundMusicPlayer::getInstance().stopMusic(); BackgroundMusicPlayer::getInstance().stopMusic();
this->setStyleSheet(originalStyle +
"QTableWidget {outline: auto;}"
"QTableWidget::item:selected {background-color: transparent;}");
return; return;
} }
this->setStyleSheet(originalStyle);
cellClicked = true; cellClicked = true;
validCellSelected = true; validCellSelected = true;
SetGridBackgroundImage(crtRow, crtColumn); SetGridBackgroundImage(crtRow, crtColumn);