X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gtk%2Fxboard.c;h=c5f81e84f6bf0b3df2fed28187ac9f3583031bcb;hb=961180c518bc7939a4b35dcb9f651176a6141e48;hp=ba492006079209a1a442ca7c68e4fa7c49f38000;hpb=513caada5cdf58b3f1b1a326043d7487baa69f35;p=xboard.git diff --git a/gtk/xboard.c b/gtk/xboard.c index ba49200..c5f81e8 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -199,7 +199,6 @@ void MoveTypeInProc P((GdkEventKey *eventkey)); gboolean KeyPressProc P((GtkWindow *window, GdkEventKey *eventkey, gpointer data)); Boolean TempBackwardActive = False; void DisplayMove P((int moveNumber)); -void ICSInitScript P((void)); void update_ics_width P(()); int CopyMemoProc P(()); static gboolean EventProc P((GtkWidget *widget, GdkEvent *event, gpointer g)); @@ -1454,11 +1453,17 @@ CoDrag (GtkWidget *sh, WindowPlacement *wp) void ReSize (WindowPlacement *wp) { - int sqx, sqy, w, h; + int sqx, sqy, w, h, lg = lineGap; 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; + sqx = (wp->width - lg - marginW) / BOARD_WIDTH - lg; + sqy = (wp->height - lg - marginH) / BOARD_HEIGHT - lg; if(sqy < sqx) sqx = sqy; + if(appData.overrideLineGap < 0) { // do second iteration with adjusted lineGap + lg = lineGap = sqx < 37 ? 1 : sqx < 59 ? 2 : sqx < 116 ? 3 : 4; + sqx = (wp->width - lg - marginW) / BOARD_WIDTH - lg; + sqy = (wp->height - lg - marginH) / BOARD_HEIGHT - lg; + if(sqy < sqx) sqx = sqy; + } if(sqx != squareSize) { //printf("new sq size %d (%dx%d)\n", sqx, wp->width, wp->height); squareSize = sqx; // adopt new square size @@ -1817,6 +1822,7 @@ void DisplayTimerLabel (Option *opt, char *color, long timer, int highlight) { GtkWidget *w = (GtkWidget *) opt->handle; + GdkColor col; char *markup; char bgcolor[10]; char fgcolor[10]; @@ -1834,6 +1840,9 @@ DisplayTimerLabel (Option *opt, char *color, long timer, int highlight) strcpy(fgcolor, appData.lowTimeWarningColor); } + gdk_color_parse( bgcolor, &col ); + gtk_widget_modify_bg(gtk_widget_get_parent(opt->handle), GTK_STATE_NORMAL, &col); + if (appData.clockMode) { markup = g_markup_printf_escaped("%s:%s%s", bgcolor, fgcolor, color, appData.logoSize && !partnerUp ? "\n" : " ", TimeString(timer));