summaryrefslogtreecommitdiff
path: root/otk/label.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-02-08 08:13:02 +0000
committerDana Jansens <danakj@orodu.net>2003-02-08 08:13:02 +0000
commitf51f1c775f3f09cf184ead323d111985c888d52e (patch)
tree22bfcdb158b450c2f7e971b206f37e5c873d79e3 /otk/label.cc
parente72d9d90f9f29809dead53968395c2c8ae5470f0 (diff)
stacked cycling menu works now. add a highlighted flag to otk widgets
Diffstat (limited to 'otk/label.cc')
-rw-r--r--otk/label.cc19
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();