]> Dogcows Code - chaz/openbox/blobdiff - otk/label.cc
enforce a min size
[chaz/openbox] / otk / label.cc
index fa5fefff2484666b9f02f23d121a4f152e5f412e..8352fb7a9b82eced7d43520344a0b62632a44810 100644 (file)
@@ -47,7 +47,15 @@ void Label::update()
       w = ft->measureString(_text) + sidemargin * 2;
     if (!_fixed_height)
       h = ft->height();
-    internalResize(w, h);
+
+    // enforce a minimum size
+    if (w > _rect.width()) {
+      if (h > _rect.height())
+        internalResize(w, h);
+      else
+        internalResize(w, _rect.height());
+    } else
+      internalResize(_rect.width(), h);
   }
   Widget::update();
 }
This page took 0.022686 seconds and 4 git commands to generate.