diff options
| author | Dana Jansens <danakj@orodu.net> | 2002-12-25 22:02:34 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2002-12-25 22:02:34 +0000 |
| commit | 2ae2b257d39ea62640c2590f794e4275c6db1cd4 (patch) | |
| tree | f26abe4a0601d263fbc460eddc012c1d674c868b /src/backgroundwidget.cc | |
| parent | 3c61812e588fb3c34d0713d7f82ccbf21091f032 (diff) | |
might not compile... ob uses its own widgets now, which subclass only the base otk widget. working on compressing focus events and handling them etc.
Diffstat (limited to 'src/backgroundwidget.cc')
| -rw-r--r-- | src/backgroundwidget.cc | 58 |
1 files changed, 44 insertions, 14 deletions
diff --git a/src/backgroundwidget.cc b/src/backgroundwidget.cc index 7d715f55..8b63b44d 100644 --- a/src/backgroundwidget.cc +++ b/src/backgroundwidget.cc @@ -10,7 +10,7 @@ namespace ob { OBBackgroundWidget::OBBackgroundWidget(otk::OtkWidget *parent, OBWidget::WidgetType type) - : otk::OtkFocusWidget(parent), + : otk::OtkWidget(parent), OBWidget(type) { } @@ -21,37 +21,67 @@ OBBackgroundWidget::~OBBackgroundWidget() } -void OBBackgroundWidget::setStyle(otk::Style *style) +void OBBackgroundWidget::setTextures() { switch (type()) { case Type_Titlebar: - setTexture(style->getTitleFocus()); - setUnfocusTexture(style->getTitleUnfocus()); - setBorderColor(style->getBorderColor()); + if (_focused) + setTexture(_style->getTitleFocus()); + else + setTexture(_style->getTitleUnfocus()); + break; + case Type_Handle: + if (_focused) + setTexture(_style->getHandleFocus()); + else + setTexture(_style->getHandleUnfocus()); break; + case Type_Plate: + if (_focused) + setBorderColor(&_style->getFrameFocus()->color()); + else + setBorderColor(&_style->getFrameUnfocus()->color()); + break; + default: + assert(false); // there's no other background widgets! + } +} + + +void OBBackgroundWidget::setStyle(otk::Style *style) +{ + OtkWidget::setStyle(style); + setTextures(); + switch (type()) { + case Type_Titlebar: case Type_Handle: - setTexture(style->getHandleFocus()); - setUnfocusTexture(style->getHandleUnfocus()); - setBorderColor(style->getBorderColor()); + setBorderColor(_style->getBorderColor()); break; case Type_Plate: - setBorderColor(&style->getFrameFocus()->color()); - setUnfocusBorderColor(&style->getFrameUnfocus()->color()); break; default: assert(false); // there's no other background widgets! } +} + + +void OBBackgroundWidget::focus() +{ + otk::OtkWidget::focus(); + setTextures(); +} + - otk::OtkFocusWidget::setStyle(style); +void OBBackgroundWidget::unfocus() +{ + otk::OtkWidget::unfocus(); + setTextures(); } void OBBackgroundWidget::adjust() { - otk::OtkFocusWidget::adjust(); - // XXX: adjust shit } - } |
