Skip to content

Commit df2da87

Browse files
committed
CellItem: Now paint a gray rect, if cell is not open.
Closes #16.
1 parent fd83713 commit df2da87

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

CellItem.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@ void CellItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
3333

3434
painter->drawRect(0, 0, cellSize, cellSize);
3535

36+
static const int border = 4;
3637
if (m_cell->isOpen()) {
3738
if (m_cell->haveMine()) {
3839
m_text->setText("+");
3940
} else if (m_cell->minesAround() > 0) {
4041
m_text->setText(QString::number(m_cell->minesAround()));
4142
}
43+
} else {
44+
painter->fillRect(border, border, cellSize - border * 2, cellSize - border * 2, Qt::lightGray);
4245
}
4346
}
4447

0 commit comments

Comments
 (0)