]> Dogcows Code - chaz/openbox/commitdiff
enforce a min size
authorDana Jansens <danakj@orodu.net>
Tue, 4 Feb 2003 15:07:39 +0000 (15:07 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 4 Feb 2003 15:07:39 +0000 (15:07 +0000)
otk/focuslabel.cc
otk/label.cc

index 6d7d5c314cf6d12a21bf7e402e5ccfe1c6ec5c90..8ac328e7122d639a892f359fb789ef3de78cd066 100644 (file)
@@ -51,7 +51,15 @@ void FocusLabel::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);
   }
   FocusWidget::update();
 }
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.02273 seconds and 4 git commands to generate.