X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=otk%2Flabel.cc;h=f0a4b66566b31749b3e0e82829cda4ba07913c82;hb=a612136ba51c87014e4fba0167aad77bbfdaa753;hp=fa5fefff2484666b9f02f23d121a4f152e5f412e;hpb=bb6ac36d410ba62bc8bb481dd6461a30aace42fd;p=chaz%2Fopenbox diff --git a/otk/label.cc b/otk/label.cc index fa5fefff..f0a4b665 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 if (h > _rect.height()) + internalResize(_rect.width(), h); } Widget::update(); }