summaryrefslogtreecommitdiff
path: root/src/backgroundwidget.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-12-18 02:28:44 +0000
committerDana Jansens <danakj@orodu.net>2002-12-18 02:28:44 +0000
commit70eb03ad50e1a71fd64c8cb1ebabbff311850553 (patch)
tree0cef2e44f7e97c0d00281df8746e7fb7f2c15f5f /src/backgroundwidget.cc
parent6bf858e4f4fc19914a36d51546278e6464ec00e0 (diff)
add an OBBackgroundWidget and use it for setting colors so far.
Diffstat (limited to 'src/backgroundwidget.cc')
-rw-r--r--src/backgroundwidget.cc57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/backgroundwidget.cc b/src/backgroundwidget.cc
new file mode 100644
index 00000000..7d715f55
--- /dev/null
+++ b/src/backgroundwidget.cc
@@ -0,0 +1,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
+}
+
+
+}