diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-05-06 11:23:41 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-05-06 11:23:41 +0000 |
| commit | 8286b441be2a182316938a5e080d0778108b69c4 (patch) | |
| tree | a7ac82a55c8ff09812b66d7a5a776e41c8cd33c5 /openbox | |
| parent | a25c5b855c006c1fe5d27c7c2f474fc463df98b6 (diff) | |
fix the popup text width, cuz the way its calculated changed
Diffstat (limited to 'openbox')
| -rw-r--r-- | openbox/popup.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/openbox/popup.c b/openbox/popup.c index 75bbdcab..b2343867 100644 --- a/openbox/popup.c +++ b/openbox/popup.c @@ -136,6 +136,7 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text) { gint l, t, r, b; gint x, y, w, h; + gint xpadding, ypadding; gint textw, texth; gint iconw; 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); 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 outer sizes */ if (self->h) { h = self->h; - texth = h - (t+b + ob_rr_theme->paddingy * 2); + texth = h - ypadding; } else - h = t+b + texth + ob_rr_theme->paddingy * 2; + h = texth + ypadding; + iconw = (self->hasicon ? texth : 0); + xpadding = l+r + iconw + ob_rr_theme->paddingx * + (self->hasicon ? 3 : 2); + if (self->w) textw = self->w; - w = l+r + textw + iconw + ob_rr_theme->paddingx * - (self->hasicon ? 3 : 2); + w = textw + xpadding; /* cap it at "maxw" */ - if (self->maxw) - w = MIN(w, self->maxw); + if (self->maxw) w = MIN(w, self->maxw); + textw = w - xpadding; /* sanity checks to avoid crashes! */ if (w < 1) w = 1; |
