Skip to content

Commit

Permalink
Merge pull request #103 from bdeyal/master
Browse files Browse the repository at this point in the history
analysis.cpp - make first move bold in analysis
  • Loading branch information
Isarhamster authored Nov 26, 2024
2 parents 6b8dd77 + b2044a2 commit bc49380
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/database/analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ QString Analysis::toString(const BoardX& board, bool hideLines) const
QString moveText;
if(!hideLines)
{
bool atLineStart = true;

foreach(Move move, variation())
{
if(whiteToMove)
Expand All @@ -243,8 +245,22 @@ QString Analysis::toString(const BoardX& board, bool hideLines) const
{
moveText += QString::number(moveNo++) + "... ";
}

if(atLineStart)
{
moveText += "<b>";
}

moveText += testBoard.moveToSan(move, true);

if(atLineStart)
{
moveText += "</b>";
atLineStart = false;
}

moveText += " ";

testBoard.doMove(move);
whiteToMove = !whiteToMove;
}
Expand Down

0 comments on commit bc49380

Please sign in to comment.