summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/ssh-askpass/SshAskpass-default.ad1
-rw-r--r--app/ssh-askpass/x11-ssh-askpass.c16
-rw-r--r--app/ssh-askpass/x11-ssh-askpass.h1
3 files changed, 17 insertions, 1 deletions
diff --git a/app/ssh-askpass/SshAskpass-default.ad b/app/ssh-askpass/SshAskpass-default.ad
index a6be0e278..ab8146309 100644
--- a/app/ssh-askpass/SshAskpass-default.ad
+++ b/app/ssh-askpass/SshAskpass-default.ad
@@ -27,6 +27,7 @@
! +-----------------------------+
*Dialog.font: -adobe-helvetica-bold-r-normal-*-*-120-*-*-*-*-iso8859-1
+*Dialog.fixedFont: -adobe-courier-bold-r-normal-*-*-120-*-*-*-*-iso8859-1
*?.foreground: rgb:00/00/00
*?.background: rgb:cc/cc/cc
*topShadowColor: rgb:ff/ff/ff
diff --git a/app/ssh-askpass/x11-ssh-askpass.c b/app/ssh-askpass/x11-ssh-askpass.c
index 6f5ef70d9..0cb68f795 100644
--- a/app/ssh-askpass/x11-ssh-askpass.c
+++ b/app/ssh-askpass/x11-ssh-askpass.c
@@ -230,13 +230,18 @@ void calcTextObjectExtents(TextObject *t, XFontStruct *font) {
void calcLabelTextExtents(LabelInfo *label)
{
TextObject *t;
+ int first = 1;
if ((!label) || (!(label->fullText)) || (!(label->font))) {
return;
}
t = label->multiText;
while (NULL != t) {
- calcTextObjectExtents(t, label->font);
+ if (first) {
+ calcTextObjectExtents(t, label->font);
+ first = 0;
+ } else
+ calcTextObjectExtents(t, label->fixedFont);
label->w.height += (t->ascent + t->descent);
if (label->w.width < t->overall.width) {
label->w.width = t->overall.width;
@@ -440,6 +445,8 @@ void createDialog(AppInfo *app)
createLabel(app, labelText, &(d->label));
freeIf(labelText);
d->label.font = getFontResource(app, "dialog.font", "Dialog.Font");
+ d->label.fixedFont = getFontResource(app, "dialog.fixedFont",
+ "Dialog.FixedFont");
calcLabelTextExtents(&(d->label));
d->label.w.foreground = d->w3.w.foreground;
d->label.w.background = d->w3.w.background;
@@ -712,6 +719,7 @@ void destroyLabel(AppInfo *app, LabelInfo *label)
}
freeIf(label->fullText);
freeFontIf(app, label->font);
+ freeFontIf(app, label->fixedFont);
}
void destroyDialog(AppInfo *app)
@@ -872,6 +880,7 @@ void paintLabel(AppInfo *app, Drawable draw, LabelInfo label)
TextObject *t;
Position x;
Position y;
+ int first = 1;
if (!(label.fullText)) {
return;
@@ -884,6 +893,11 @@ void paintLabel(AppInfo *app, Drawable draw, LabelInfo label)
x = label.w.x;
y = label.w.y + t->ascent;
while (NULL != t) {
+ if (!first)
+ XSetFont(app->dpy, app->textGC, label.fixedFont->fid);
+ else
+ first = 0;
+
if (t->text) {
XDrawString(app->dpy, draw, app->textGC, x, y, t->text,
t->textLength);
diff --git a/app/ssh-askpass/x11-ssh-askpass.h b/app/ssh-askpass/x11-ssh-askpass.h
index f419c5d72..547d2a38f 100644
--- a/app/ssh-askpass/x11-ssh-askpass.h
+++ b/app/ssh-askpass/x11-ssh-askpass.h
@@ -87,6 +87,7 @@ typedef struct
{
char *fullText;
XFontStruct *font;
+ XFontStruct *fixedFont;
TextObject *multiText;
WidgetInfo w;
} LabelInfo;