{
extern Option historyOptions[], engoutOptions[], gamesOptions[], chatOptions[];
int i;
+ PopDown(TransientDlg); // Early popdown to prevent expose events frommasking each other
+ LockBoardSize(0);
DisplayBothClocks();
ApplyFont(&mainOptions[W_MESSG], NULL);
for(i=1; i<6; i++) ApplyFont(&mainOptions[W_BUTTON+i], NULL);
+ LockBoardSize(1);
ApplyFont(&tagsOptions[1], NULL);
ApplyFont(&historyOptions[0], NULL);
ApplyFont(&engoutOptions[5], NULL);
ApplyFont(&chatOptions[11], appData.icsFont);
AppendColorized(&chatOptions[6], NULL, 0); // kludge to replace font tag
DrawPosition(TRUE, NULL); // for coord font
- return 1;
+ return 0; // suppress normal popdown because already done
}
static Option fontOptions[] = {
void WidgetEcho P((Option *opt, int n));
int ErrorOK P((int n));
void ApplyFont P((Option *opt, char *font));
+void LockBoardSize P((int after));
// in ngamelist.c
#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)
{
Browse(BoardWindow, label, (def[0] ? def : NULL), filter, False, openMode, openName, openFP);
}
+
+void
+LockBoardSize (int after)
+{
+}