diff options
Diffstat (limited to 'otk/label.cc')
| -rw-r--r-- | otk/label.cc | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/otk/label.cc b/otk/label.cc index 0c18b5d0..c56f91f8 100644 --- a/otk/label.cc +++ b/otk/label.cc @@ -16,7 +16,8 @@ Label::Label(Widget *parent) : Widget(parent), _text(""), _justify_horz(RenderStyle::LeftTopJustify), - _justify_vert(RenderStyle::LeftTopJustify) + _justify_vert(RenderStyle::LeftTopJustify), + _highlight(true) { styleChanged(*RenderStyle::style(screen())); } @@ -37,6 +38,13 @@ void Label::setVerticalJustify(RenderStyle::Justify j) refresh(); } +void Label::setHighlighted(bool h) +{ + _highlight = h; + styleChanged(*RenderStyle::style(screen())); + refresh(); +} + void Label::setText(const ustring &text) { bool utf = text.utf8(); @@ -77,8 +85,13 @@ void Label::calcDefaultSizes() void Label::styleChanged(const RenderStyle &style) { - _texture = style.labelFocusBackground(); - _forecolor = style.textFocusColor(); + if (_highlight) { + _texture = style.labelFocusBackground(); + _forecolor = style.textFocusColor(); + } else { + _texture = style.labelUnfocusBackground(); + _forecolor = style.textUnfocusColor(); + } _font = style.labelFont(); Widget::styleChanged(style); calcDefaultSizes(); |
