all repos — openbox @ b8735c759a0a638a1169089c310baf9de6414597

openbox fork - make it a bit more like ryudo

enforce a min size
Dana Jansens danakj@orodu.net
commit

b8735c759a0a638a1169089c310baf9de6414597

parent

9e6b0d5a8d0226232802bdece77665b167f98dae

2 files changed, 18 insertions(+), 2 deletions(-)

jump to
M otk/focuslabel.ccotk/focuslabel.cc

@@ -51,7 +51,15 @@ if (!_fixed_width)

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(); }
M otk/label.ccotk/label.cc

@@ -47,7 +47,15 @@ if (!_fixed_width)

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(); }