fix the popup text width, cuz the way its calculated changed

This commit is contained in:
Dana Jansens 2007-05-06 11:23:41 +00:00
parent a25c5b855c
commit 8286b441be

View file

@ -136,6 +136,7 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text)
{ {
gint l, t, r, b; gint l, t, r, b;
gint x, y, w, h; gint x, y, w, h;
gint xpadding, ypadding;
gint textw, texth; gint textw, texth;
gint iconw; gint iconw;
Rect *area; /* won't go outside this */ Rect *area; /* won't go outside this */
@ -157,21 +158,26 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text)
RrMinSize(self->a_text, &textw, &texth); RrMinSize(self->a_text, &textw, &texth);
texth += ob_rr_theme->paddingy * 2; texth += ob_rr_theme->paddingy * 2;
ypadding = (t+b + ob_rr_theme->paddingy * 2);
/* set the sizes up and reget the text sizes from the calculated /* set the sizes up and reget the text sizes from the calculated
outer sizes */ outer sizes */
if (self->h) { if (self->h) {
h = self->h; h = self->h;
texth = h - (t+b + ob_rr_theme->paddingy * 2); texth = h - ypadding;
} else } else
h = t+b + texth + ob_rr_theme->paddingy * 2; h = texth + ypadding;
iconw = (self->hasicon ? texth : 0); iconw = (self->hasicon ? texth : 0);
xpadding = l+r + iconw + ob_rr_theme->paddingx *
(self->hasicon ? 3 : 2);
if (self->w) if (self->w)
textw = self->w; textw = self->w;
w = l+r + textw + iconw + ob_rr_theme->paddingx * w = textw + xpadding;
(self->hasicon ? 3 : 2);
/* cap it at "maxw" */ /* cap it at "maxw" */
if (self->maxw) if (self->maxw) w = MIN(w, self->maxw);
w = MIN(w, self->maxw); textw = w - xpadding;
/* sanity checks to avoid crashes! */ /* sanity checks to avoid crashes! */
if (w < 1) w = 1; if (w < 1) w = 1;