X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xboard.c;h=6bc77ccce9fc3c3b8662c442bf53bacb0b0bd9b2;hb=7e0222e64da6706bf0dc2468f459b98e4346206b;hp=62b696b610af20e2707576a8c67ad05817e98bbe;hpb=ee187f36388670ebf4e2666c8118d7344d670ed9;p=xboard.git diff --git a/xboard.c b/xboard.c index 62b696b..6bc77cc 100644 --- a/xboard.c +++ b/xboard.c @@ -275,8 +275,6 @@ int xtVersion = XtSpecificationRelease; int xScreen; Display *xDisplay; Window xBoardWindow; -Pixel lightSquareColor, darkSquareColor, whitePieceColor, blackPieceColor, - highlightSquareColor, premoveHighlightColor; // used in graphics Pixel lowTimeWarningColor, dialogColor, buttonColor; // used in widgets Pixmap iconPixmap, wIconPixmap, bIconPixmap, xMarkPixmap; Widget shellWidget, formWidget, boardWidget, titleWidget, dropMenu, menuBarWidget; @@ -911,12 +909,6 @@ MakeColors () { // [HGM] taken out of main(), so it can be called from BoardOptions dialog int forceMono = False; - forceMono |= MakeOneColor(appData.lightSquareColor, &lightSquareColor); - forceMono |= MakeOneColor(appData.darkSquareColor, &darkSquareColor); - forceMono |= MakeOneColor(appData.whitePieceColor, &whitePieceColor); - forceMono |= MakeOneColor(appData.blackPieceColor, &blackPieceColor); - forceMono |= MakeOneColor(appData.highlightSquareColor, &highlightSquareColor); - forceMono |= MakeOneColor(appData.premoveHighlightColor, &premoveHighlightColor); if (appData.lowTimeWarning) forceMono |= MakeOneColor(appData.lowTimeWarningColor, &lowTimeWarningColor); if(appData.dialogColor[0]) MakeOneColor(appData.dialogColor, &dialogColor); @@ -1590,18 +1582,6 @@ ReadBitmap (Pixmap *pm, String name, unsigned char bits[], u_int wreq, u_int hre } void -MarkMenuItem (char *menuRef, int state) -{ - MenuItem *item = MenuNameToItem(menuRef); - - if(item) { - Arg args[2]; - XtSetArg(args[0], XtNleftBitmap, state ? xMarkPixmap : None); - XtSetValues(item->handle, args, 1); - } -} - -void EnableNamedMenuItem (char *menuRef, int state) { MenuItem *item = MenuNameToItem(menuRef); @@ -1732,7 +1712,7 @@ CoDrag (Widget sh, WindowPlacement *wp) void ReSize (WindowPlacement *wp) { - int sqx, sqy; + int sqx, sqy, w, h; if(wp->width == wpMain.width && wp->height == wpMain.height) return; // not sized sqx = (wp->width - lineGap - marginW) / BOARD_WIDTH - lineGap; sqy = (wp->height - lineGap - marginH) / BOARD_HEIGHT - lineGap; @@ -1742,6 +1722,10 @@ ReSize (WindowPlacement *wp) CreatePNGPieces(); // make newly scaled pieces InitDrawingSizes(0, 0); // creates grid etc. } else ResizeBoardWindow(BOARD_WIDTH * (squareSize + lineGap) + lineGap, BOARD_HEIGHT * (squareSize + lineGap) + lineGap, 0); + w = BOARD_WIDTH * (squareSize + lineGap) + lineGap; + h = BOARD_HEIGHT * (squareSize + lineGap) + lineGap; + if(optList[W_BOARD].max > w) optList[W_BOARD].max = w; + if(optList[W_BOARD].value > h) optList[W_BOARD].value = h; } static XtIntervalId delayedDragID = 0;