namespace ob {
-OBBackgroundWidget::OBBackgroundWidget(otk::OtkWidget *parent,
- OBWidget::WidgetType type)
- : otk::OtkFocusWidget(parent),
- OBWidget(type)
+BackgroundWidget::BackgroundWidget(otk::Widget *parent,
+ WidgetBase::WidgetType type)
+ : otk::Widget(parent),
+ WidgetBase(type)
{
}
-OBBackgroundWidget::~OBBackgroundWidget()
+BackgroundWidget::~BackgroundWidget()
{
}
-void OBBackgroundWidget::setStyle(otk::Style *style)
+void BackgroundWidget::setTextures()
{
switch (type()) {
case Type_Titlebar:
- setTexture(style->getTitleFocus());
- setUnfocusTexture(style->getTitleUnfocus());
- setBorderColor(style->getBorderColor());
+ if (_focused)
+ setTexture(_style->titlebarFocusBackground());
+ else
+ setTexture(_style->titlebarUnfocusBackground());
break;
case Type_Handle:
- setTexture(style->getHandleFocus());
- setUnfocusTexture(style->getHandleUnfocus());
- setBorderColor(style->getBorderColor());
+ if (_focused)
+ setTexture(_style->handleFocusBackground());
+ else
+ setTexture(_style->handleUnfocusBackground());
break;
case Type_Plate:
- setBorderColor(&style->getFrameFocus()->color());
- setUnfocusBorderColor(&style->getFrameUnfocus()->color());
+ if (_focused)
+ setBorderColor(_style->clientBorderFocusColor());
+ else
+ setBorderColor(_style->clientBorderUnfocusColor());
break;
default:
assert(false); // there's no other background widgets!
}
+}
+
- otk::OtkFocusWidget::setStyle(style);
+void BackgroundWidget::setStyle(otk::RenderStyle *style)
+{
+ Widget::setStyle(style);
+ setTextures();
+ switch (type()) {
+ case Type_Titlebar:
+ case Type_Handle:
+ setBorderColor(_style->frameBorderColor());
+ break;
+ case Type_Plate:
+ break;
+ default:
+ assert(false); // there's no other background widgets!
+ }
}
-void OBBackgroundWidget::adjust()
+void BackgroundWidget::focus()
{
- otk::OtkFocusWidget::adjust();
+ otk::Widget::focus();
+ setTextures();
+}
+
- // XXX: adjust shit
+void BackgroundWidget::unfocus()
+{
+ otk::Widget::unfocus();
+ setTextures();
}
+void BackgroundWidget::adjust()
+{
+ // nothing to adjust here. its done in Frame::adjustSize
+}
+
}