X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=dialogs.c;h=42e6379d1e2b3319c570cbb42e8b7ef8527467e7;hb=ac9d48038a86a672579abbcbbc53b17e2515ba13;hp=61085f7592315f318376cdc6e107569c14b11126;hpb=f2d58fb3e53e223517fbaae950f29aa09a4fa9a5;p=xboard.git diff --git a/dialogs.c b/dialogs.c index 61085f7..42e6379 100644 --- a/dialogs.c +++ b/dialogs.c @@ -752,11 +752,14 @@ SoundOptionsProc () static void DefColor P((int n)); static void AdjustColor P((int i)); +static char oldPngDir[MSG_SIZ]; +static char oldSvgDir[MSG_SIZ]; + static int BoardOptionsOK (int n) { if(appData.overrideLineGap >= 0) lineGap = appData.overrideLineGap; else lineGap = defaultLineGap; - InitDrawingParams(); + InitDrawingParams(strcmp(oldPngDir, appData.pngDirectory) || strcmp(oldSvgDir, appData.svgDirectory)); InitDrawingSizes(-1, 0); DrawPosition(True, NULL); return 1; @@ -811,6 +814,7 @@ static Option boardOptions[] = { { 0, 0, 0, NULL, (void*) &appData.liteBackTextureFile, ".xpm", NULL, FileName, N_("Light-Squares Texture File:") }, { 0, 0, 0, NULL, (void*) &appData.darkBackTextureFile, ".xpm", NULL, FileName, N_("Dark-Squares Texture File:") }, { 0, 0, 0, NULL, (void*) &appData.pngDirectory, "", NULL, PathName, N_("Directory with PNG Pieces:") }, +{ 0, 0, 0, NULL, (void*) &appData.svgDirectory, "", NULL, PathName, N_("Directory with SVG Pieces:") }, { 0, 0, 0, NULL, (void*) &BoardOptionsOK, "", NULL, EndMark , "" } }; @@ -859,6 +863,8 @@ AdjustColor (int i) void BoardOptionsProc () { + strncpy(oldPngDir, appData.pngDirectory, MSG_SIZ-1); // to see if it changed + strncpy(oldSvgDir, appData.svgDirectory, MSG_SIZ-1); // to see if it changed GenericPopUp(boardOptions, _("Board Options"), TransientDlg, BoardWindow, MODAL, 0); } @@ -1928,7 +1934,7 @@ static int pmFromX = -1, pmFromY = -1; void *userLogo; void -DisplayLogos (void *w1, void *w2) +DisplayLogos (Option *w1, Option *w2) { void *whiteLogo = first.programLogo, *blackLogo = second.programLogo; if(appData.autoLogo) { @@ -2015,14 +2021,14 @@ Option mainOptions[] = { // description of main window in terms of generic dialo Option * LogoW (int n, int x, int y) { - if(n == 10) DisplayLogos(mainOptions[W_WHITE-1].handle, NULL); + if(n == 10) DisplayLogos(&mainOptions[W_WHITE-1], NULL); return NULL; } Option * LogoB (int n, int x, int y) { - if(n == 10) DisplayLogos(NULL, mainOptions[W_BLACK+1].handle); + if(n == 10) DisplayLogos(NULL, &mainOptions[W_BLACK+1]); return NULL; } @@ -2047,8 +2053,8 @@ MenuCallback (int n) static Option * Exp (int n, int x, int y) { - static int but1, but3; - int menuNr = -3; + static int but1, but3, oldW, oldH; + int menuNr = -3, sizing; if(n == 0) { // motion if(SeekGraphClick(Press, x, y, 1)) return NULL; @@ -2068,6 +2074,10 @@ Exp (int n, int x, int y) case -2: shiftKey = !shiftKey; case -3: menuNr = RightClick(Release, x, y, &pmFromX, &pmFromY), but3 = 0; break; case 10: + sizing = (oldW != x || oldH != y); + oldW = x; oldH = y; + InitDrawingHandle(mainOptions + W_BOARD); + if(sizing) return NULL; // don't redraw while sizing DrawPosition(True, NULL); default: return NULL;