- h = t+b + texth + ob_rr_theme->paddingy * 2;
- iconw = (self->hasicon ? texth : 0);
- if (self->w)
- textw = self->w;
- w = l+r + textw + iconw + ob_rr_theme->paddingx *
- (self->hasicon ? 3 : 2);
- /* cap it at "maxw" */
- if (self->maxw)
- w = MIN(w, self->maxw);
+ h = texth + emptyy;
+
+ if (self->textw)
+ textw = self->textw;
+
+ iconx = textx = l + ob_rr_theme->paddingx;
+ icony = texty = t + ob_rr_theme->paddingy;
+
+ emptyx = l + r + ob_rr_theme->paddingx * 2;
+ if (self->hasicon) {
+ iconw = iconh = texth;
+ textx += iconw + ob_rr_theme->paddingx;
+ if (textw)
+ emptyx += ob_rr_theme->paddingx; /* between the icon and text */
+ } else
+ iconw = 0;
+
+ w = textw + emptyx + iconw;
+ /* cap it at maxw/minw */
+ if (self->maxw) w = MIN(w, self->maxw);
+ if (self->minw) w = MAX(w, self->minw);
+ textw = w - emptyx - iconw;