From f51f1c775f3f09cf184ead323d111985c888d52e Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 8 Feb 2003 08:13:02 +0000 Subject: stacked cycling menu works now. add a highlighted flag to otk widgets --- otk/label.cc | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'otk/label.cc') 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(); -- cgit v1.2.3