From: H.G.Muller Date: Fri, 5 Feb 2016 09:06:09 +0000 (+0100) Subject: Fix clipping of GTK menu-bar labels for broad boards X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=6ca807f73dc2b01a2e36161775ef880c3b448c0d Fix clipping of GTK menu-bar labels for broad boards The number of characters kept in the menu-bar labels was dependent on square size, but did not take into account the number of files of the board. So when there were more than 8 files, the label texts were often clipped while there was in fact plenty of room to display them fully. Now the adjustment of square size based on number of board files is done after the other window parameters have been picked based on the window width calculated as 8*squareSize. Only the default line gap is then adapted to the actual square size (consistent with what is done during user sizing of the board later). --- diff --git a/gtk/xboard.c b/gtk/xboard.c index e269958..573db11 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -1020,8 +1020,6 @@ main (int argc, char **argv) programName, appData.boardSize); exit(2); } - if(BOARD_WIDTH > 8) - squareSize = (squareSize*8 + BOARD_WIDTH/2)/BOARD_WIDTH; // scale height if (i < 7) { /* Find some defaults; use the nearest known size */ SizeDefaults *szd, *nearest; @@ -1073,6 +1071,11 @@ main (int argc, char **argv) tinyLayout = szd->tinyLayout; // [HGM] font: use defaults from settings file if available and not overruled } + if(BOARD_WIDTH != 8) { + squareSize = (squareSize*8 + BOARD_WIDTH/2)/BOARD_WIDTH; // keep width the same + lineGap = (squareSize < 37 ? 1 : squareSize < 59 ? 2 : squareSize < 116 ? 3 : 4); +printf("squareSize=%d lineGap=%d\n",squareSize,lineGap); + } defaultLineGap = lineGap; if(appData.overrideLineGap >= 0) lineGap = appData.overrideLineGap;