]> Dogcows Code - chaz/openbox/blobdiff - otk/label.cc
various fixes to the otk widgets
[chaz/openbox] / otk / label.cc
index fa5fefff2484666b9f02f23d121a4f152e5f412e..f0a4b66566b31749b3e0e82829cda4ba07913c82 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 if (h > _rect.height())
+      internalResize(_rect.width(), h);
   }
   Widget::update();
 }
This page took 0.019982 seconds and 4 git commands to generate.