summaryrefslogtreecommitdiff
path: root/src/styleengine.cc
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-02-17 11:57:06 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-02-17 11:57:06 +0100
commitf1f1a6e75aae930a2b5ad9406303e2577fcb7743 (patch)
treedc43feccd134bebc3155dc8c8f464f72950ed4a3 /src/styleengine.cc
parentf439ac9b889ce757133f8cb5d261381190e2065f (diff)
fix missing background color for ComplexButton (noticed by corvid)
Diffstat (limited to 'src/styleengine.cc')
-rw-r--r--src/styleengine.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/styleengine.cc b/src/styleengine.cc
index 5c6f0972..d9ec3ff2 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -465,6 +465,21 @@ bool StyleEngine::computeLength (dw::core::style::Length *dest,
}
/**
+ * \brief Similar to StyleEngine::style(), but with backgroundColor set.
+ * A normal style might have backgroundColor == NULL to indicate a transparent
+ * background. This method ensures that backgroundColor is set.
+ */
+Style * StyleEngine::backgroundStyle () {
+ StyleAttrs attrs = *style ();
+
+ for (int i = stack->size () - 1; i >= 0 && ! attrs.backgroundColor; i--)
+ attrs.backgroundColor = stack->getRef (i)->style->backgroundColor;
+
+ assert (attrs.backgroundColor);
+ return Style::create (layout, &attrs);
+}
+
+/**
* \brief Create a new style object based on the previously opened / closed
* HTML elements and the nonCssProperties that have been set.
* This method is private. Call style() to get a current style object.