From 97d28802c3f1166f64a2cc32da74d829a60d8243 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Fri, 10 Feb 2012 17:13:36 +0100 Subject: [PATCH] Fix position of checkbox XB With the large height the widget get in internationalization, the checkboxes are position way too high above the text. To shift them down a dummy borderless label widget is drawn above them (when needed). --- xboard.c | 5 ++--- xoptions.c | 12 +++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/xboard.c b/xboard.c index 311d7f1..310274d 100644 --- a/xboard.c +++ b/xboard.c @@ -2314,9 +2314,7 @@ XBoard square size (hint): %d\n\ messageArgs, XtNumber(messageArgs)); XtSetArg(args[0], XtNtop, XtChainTop); XtSetArg(args[1], XtNbottom, XtChainTop); - XtSetValues(messageWidget, args, 2); - XtSetArg(args[0], XtNheight, &textHeight); // [HGM] get height for use in generic popup - XtGetValues(messageWidget, args, 1); + XtSetValues(messageWidget, args, 3); widgetList[j++] = boardWidget = XtCreateWidget("board", widgetClass, formWidget, boardArgs, @@ -2462,6 +2460,7 @@ XBoard square size (hint): %d\n\ fprintf(stderr, _("%s: messageWidget geometry error %d %d %d %d %d\n"), programName, gres, w, h, wr, hr); } + textHeight = hr; // [HGM] save height for use in generic popup /* !! end hack */ XtSetArg(args[0], XtNleft, XtChainLeft); // [HGM] glue ends for good run-time sizing XtSetArg(args[1], XtNright, XtChainRight); diff --git a/xoptions.c b/xoptions.c index a21d487..446cf15 100644 --- a/xoptions.c +++ b/xoptions.c @@ -1154,9 +1154,19 @@ GenericPopUp (Option *option, char *title, int dlgNr) break; case CheckBox: if(!currentCps) option[i].value = *(Boolean*)option[i].target; - j=0; + j=0; // space holder XtSetArg(args[j], XtNfromVert, last); j++; XtSetArg(args[j], XtNwidth, 10); j++; + XtSetArg(args[j], XtNheight, textHeight-22); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; + XtSetArg(args[j], XtNborderWidth, 0); j++; +printf("%d\n",textHeight); + if(textHeight < 24) dialog = last; else + dialog = XtCreateManagedWidget(" ", labelWidgetClass, form, args, j); + j=0; + XtSetArg(args[j], XtNfromVert, dialog); j++; + XtSetArg(args[j], XtNwidth, 10); j++; XtSetArg(args[j], XtNheight, 10); j++; XtSetArg(args[j], XtNleft, XtChainLeft); j++; XtSetArg(args[j], XtNright, XtChainLeft); j++; -- 1.7.0.4