From 88b38b2afba14d45b1334613c0074a579f622f6f Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Thu, 29 Nov 2012 22:23:44 +0100 Subject: [PATCH] Use colors in Board-Options dialog also for font pieces (WB) The piece color settings now control the pieceColor or fontPieceColor settings, depending on the setting of -usePieceFont. --- winboard/woptions.c | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/winboard/woptions.c b/winboard/woptions.c index cfd5cdb..3457b91 100644 --- a/winboard/woptions.c +++ b/winboard/woptions.c @@ -608,8 +608,9 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) lsc = lightSquareColor; dsc = darkSquareColor; - wpc = whitePieceColor; - bpc = blackPieceColor; + fonts = appData.useFont; + wpc = fonts ? appData.fontBackColorWhite : whitePieceColor; + bpc = fonts ? appData.fontForeColorBlack : blackPieceColor; hsc = highlightSquareColor; phc = premoveHighlightColor; mono = appData.monoMode; @@ -617,7 +618,6 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) flip = appData.upsideDown; size = boardSize; bitmaps = appData.useBitmaps; - fonts = appData.useFont; grid = appData.overrideLineGap >= 0; SetBoardOptionEnables(hDlg); @@ -661,8 +661,8 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) if ((mono != appData.monoMode) || (lsc != lightSquareColor) || (dsc != darkSquareColor) || - (wpc != whitePieceColor) || - (bpc != blackPieceColor) || + (wpc != fonts ? appData.fontBackColorWhite : whitePieceColor) || + (bpc != fonts ? appData.fontForeColorBlack : blackPieceColor) || (hsc != highlightSquareColor) || (flip != appData.upsideDown) || (white != appData.allWhite) || @@ -673,8 +673,13 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) lightSquareColor = lsc; darkSquareColor = dsc; - whitePieceColor = wpc; - blackPieceColor = bpc; + if(fonts) { + appData.fontBackColorWhite = wpc; + appData.fontForeColorBlack = bpc; + } else { + whitePieceColor = wpc; + blackPieceColor = bpc; + } highlightSquareColor = hsc; premoveHighlightColor = phc; appData.monoMode = mono; -- 1.7.0.4