]> icculus.org git repositories - mikachu/openbox.git/blob - src/backgroundwidget.cc
add an OBBackgroundWidget and use it for setting colors so far.
[mikachu/openbox.git] / src / backgroundwidget.cc
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2
3 #ifdef HAVE_CONFIG_H
4 # include "../config.h"
5 #endif
6
7 #include "backgroundwidget.hh"
8
9 namespace ob {
10
11 OBBackgroundWidget::OBBackgroundWidget(otk::OtkWidget *parent,
12                                        OBWidget::WidgetType type)
13   : otk::OtkFocusWidget(parent),
14     OBWidget(type)
15 {
16 }
17
18
19 OBBackgroundWidget::~OBBackgroundWidget()
20 {
21 }
22
23
24 void OBBackgroundWidget::setStyle(otk::Style *style)
25 {
26   switch (type()) {
27   case Type_Titlebar:
28     setTexture(style->getTitleFocus());
29     setUnfocusTexture(style->getTitleUnfocus());
30     setBorderColor(style->getBorderColor());
31     break;
32   case Type_Handle:
33     setTexture(style->getHandleFocus());
34     setUnfocusTexture(style->getHandleUnfocus());
35     setBorderColor(style->getBorderColor());
36     break;
37   case Type_Plate:
38     setBorderColor(&style->getFrameFocus()->color());
39     setUnfocusBorderColor(&style->getFrameUnfocus()->color());
40     break;
41   default:
42     assert(false); // there's no other background widgets!
43   }
44
45   otk::OtkFocusWidget::setStyle(style);
46 }
47
48
49 void OBBackgroundWidget::adjust()
50 {
51   otk::OtkFocusWidget::adjust();
52
53   // XXX: adjust shit
54 }
55
56
57 }