- RrMinSize(self->a_text, &textw, &texth);
- texth += 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);
- } else
- h = t+b + texth + ob_rr_theme->paddingy * 2;
- iconw = (self->hasicon ? texth : 0);
- if (self->w) {
- w = self->w;
- textw = w - (l+r + iconw + ob_rr_theme->paddingx *
- (self->hasicon ? 3 : 2));
+ if (text[0] != '\0') {
+ RrMinSize(self->a_text, &textw, &texth);
+ } else {
+ textw = 0;
+ texth = RrMinHeight(self->a_text);
+ }
+
+ /* get the height, which is also used for the icon width */
+ emptyy = t + b + ob_rr_theme->paddingy * 2;
+ if (self->h)
+ texth = self->h - emptyy;
+ h = texth * self->iconhm + emptyy;
+
+ if (self->textw)
+ textw = self->textw;
+
+ iconx = textx = l + ob_rr_theme->paddingx;
+
+ emptyx = l + r + ob_rr_theme->paddingx * 2;
+ if (self->hasicon) {
+ iconw = texth * self->iconwm;
+ iconh = texth * self->iconhm;
+ textx += iconw + ob_rr_theme->paddingx;
+ if (textw)
+ emptyx += ob_rr_theme->paddingx; /* between the icon and text */