X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Ffocuslabel.cc;h=846d035ebb78de0317161796e1009535b505db32;hb=59ef3022a4ce0a23e6d54f7d73a2aa77721e9cc9;hp=8ac328e7122d639a892f359fb789ef3de78cd066;hpb=b8735c759a0a638a1169089c310baf9de6414597;p=chaz%2Fopenbox diff --git a/otk/focuslabel.cc b/otk/focuslabel.cc index 8ac328e7..846d035e 100644 --- a/otk/focuslabel.cc +++ b/otk/focuslabel.cc @@ -37,8 +37,8 @@ void FocusLabel::fitString(const std::string &str) void FocusLabel::fitSize(int w, int h) { - unsigned int sidemargin = style()->bevelWidth() * 2; - resize(w + sidemargin * 2, h); + unsigned int sidemargin = _bevel_width * 2; + resize(w + sidemargin * 2, h + _bevel_width * 2); } void FocusLabel::update() @@ -46,7 +46,7 @@ void FocusLabel::update() if (_dirty) { int w = _rect.width(), h = _rect.height(); const Font *ft = style()->labelFont(); - unsigned int sidemargin = style()->bevelWidth() * 2; + unsigned int sidemargin = _bevel_width * 2; if (!_fixed_width) w = ft->measureString(_text) + sidemargin * 2; if (!_fixed_height) @@ -58,7 +58,7 @@ void FocusLabel::update() internalResize(w, h); else internalResize(w, _rect.height()); - } else + } else if (h > _rect.height()) internalResize(_rect.width(), h); } FocusWidget::update(); @@ -72,7 +72,7 @@ void FocusLabel::renderForeground() const Font *ft = style()->labelFont(); RenderColor *text_color = (isFocused() ? style()->textFocusColor() : style()->textUnfocusColor()); - unsigned int sidemargin = style()->bevelWidth() * 2; + unsigned int sidemargin = _bevel_width * 2; ustring t = _text; // the actual text to draw int x = sidemargin; // x coord for the text @@ -104,7 +104,7 @@ void FocusLabel::renderForeground() } display->renderControl(_screen)-> - drawString(*_surface, *ft, x, 0, *text_color, t); + drawString(*_surface, *ft, x, _bevel_width, *text_color, t); } }