X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=blobdiff_plain;f=gtk%2Fxboard.c;h=03f2f9a2a7165eac9da16406e8a80b56a5931a78;hp=8dc5253e5afae3ff4bbb4f60406a632eb8a05ea1;hb=f5445dab3a8035dfdfa3eb8581d323c0661390fb;hpb=39298ae34f47966df637ad5044250a7a2a15e46a diff --git a/gtk/xboard.c b/gtk/xboard.c index 8dc5253..03f2f9a 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -2057,6 +2057,25 @@ DisplayIcsInteractionTitle (String message) #endif } +void +LockBoardSize (int after) +{ + static char *oldClockFont, *oldMessgFont; + int w, h; + if(oldMessgFont && !strcmp(oldMessgFont, appData.font) && + oldClockFont && !strcmp(oldClockFont, appData.clockFont) ) return; // only do something when font changed + w = BOARD_WIDTH*(squareSize + lineGap) + lineGap; + h = BOARD_HEIGHT*(squareSize + lineGap) + lineGap; + if(after) { + ASSIGN(oldClockFont, appData.clockFont); + ASSIGN(oldMessgFont, appData.font); + gtk_window_resize(GTK_WINDOW(shellWidget), w, h); + DoEvents(); + gtk_widget_set_size_request(optList[W_BOARD].handle, -1, -1); // liberate board + } else { // before + gtk_widget_set_size_request(optList[W_BOARD].handle, w, h); // protect board widget + } +} void DisplayTimerLabel (Option *opt, char *color, long timer, int highlight)