X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Flabel.cc;h=8352fb7a9b82eced7d43520344a0b62632a44810;hb=b8735c759a0a638a1169089c310baf9de6414597;hp=fa5fefff2484666b9f02f23d121a4f152e5f412e;hpb=bb6ac36d410ba62bc8bb481dd6461a30aace42fd;p=chaz%2Fopenbox diff --git a/otk/label.cc b/otk/label.cc index fa5fefff..8352fb7a 100644 --- a/otk/label.cc +++ b/otk/label.cc @@ -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(); }