- const Font *ft = style()->getFont();
- Color *text_color = (isFocused() ? style()->getTextFocus()
- : style()->getTextUnfocus());
- unsigned int sidemargin = style()->getBevelWidth() * 2;
+ if (_dirty) {
+ int w = _rect.width(), h = _rect.height();
+ const Font *ft = style()->labelFont();
+ unsigned int sidemargin = style()->bevelWidth() * 2;
+ if (!_fixed_width)
+ w = ft->measureString(_text) + sidemargin * 2;
+ if (!_fixed_height)
+ h = ft->height();
+ internalResize(w, h);
+ }
+ FocusWidget::update();
+}
+
+
+void FocusLabel::renderForeground()
+{
+ FocusWidget::renderForeground();
+
+ const Font *ft = style()->labelFont();
+ RenderColor *text_color = (isFocused() ? style()->textFocusColor()
+ : style()->textUnfocusColor());
+ unsigned int sidemargin = style()->bevelWidth() * 2;