X11 pop-up dialog width
- the response field of the pop-up dialog was getting smaller by a few pixels each time it was used. This was because the width calculation was effectively stripping off the margins (4 pixels total) each time. Don't do that.
This commit is contained in:
@@ -52,6 +52,7 @@ win32tty: honour the use_inverse option and default to ATR_BOLD if disabled
|
||||
X11: restore support for non-square tiles when USE_XPM is defined
|
||||
Gnome: add support for non-square tiles
|
||||
tty: remove #define DEBUG that forced debug behavior in production builds
|
||||
X11: getlin dialog got steadily narrower each time it was used
|
||||
|
||||
|
||||
General New Features
|
||||
|
||||
@@ -241,7 +241,7 @@ SetDialogResponse(w, s)
|
||||
Arg args[4];
|
||||
Widget response;
|
||||
XFontStruct *font;
|
||||
Dimension width, nwidth, tmp, leftMargin, rightMargin;
|
||||
Dimension width, nwidth, leftMargin, rightMargin;
|
||||
|
||||
response = XtNameToWidget(w, "response");
|
||||
XtSetArg(args[0], XtNfont, &font);
|
||||
@@ -249,10 +249,10 @@ SetDialogResponse(w, s)
|
||||
XtSetArg(args[2], XtNrightMargin, &rightMargin);
|
||||
XtSetArg(args[3], XtNwidth, &width);
|
||||
XtGetValues(response, args, FOUR);
|
||||
/* width includes margins as per Xaw documentation */
|
||||
nwidth = (font->max_bounds.width * strlen(s))+leftMargin+rightMargin;
|
||||
tmp = width-(leftMargin+rightMargin);
|
||||
if (nwidth < tmp)
|
||||
nwidth = tmp;
|
||||
if (nwidth < width)
|
||||
nwidth = width;
|
||||
|
||||
XtSetArg(args[0], XtNstring, s);
|
||||
XtSetArg(args[1], XtNwidth, nwidth);
|
||||
|
||||
Reference in New Issue
Block a user