summaryrefslogtreecommitdiff
path: root/src/backgroundwidget.cc
blob: 7d715f55e336a89f9eb373a706ce1c12422cf39c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-

#ifdef HAVE_CONFIG_H
# include "../config.h"
#endif

#include "backgroundwidget.hh"

namespace ob {

OBBackgroundWidget::OBBackgroundWidget(otk::OtkWidget *parent,
                                       OBWidget::WidgetType type)
  : otk::OtkFocusWidget(parent),
    OBWidget(type)
{
}


OBBackgroundWidget::~OBBackgroundWidget()
{
}


void OBBackgroundWidget::setStyle(otk::Style *style)
{
  switch (type()) {
  case Type_Titlebar:
    setTexture(style->getTitleFocus());
    setUnfocusTexture(style->getTitleUnfocus());
    setBorderColor(style->getBorderColor());
    break;
  case Type_Handle:
    setTexture(style->getHandleFocus());
    setUnfocusTexture(style->getHandleUnfocus());
    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!
  }

  otk::OtkFocusWidget::setStyle(style);
}


void OBBackgroundWidget::adjust()
{
  otk::OtkFocusWidget::adjust();

  // XXX: adjust shit
}


}