aboutsummaryrefslogtreecommitdiff
path: root/src/styleengine.cc
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-12-11 21:03:05 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-12-11 21:03:05 +0100
commitbe685e429d1f884df7270ae101223c81b9f8338c (patch)
tree4e005ba39507112c058ea6d02242712a872f400a /src/styleengine.cc
parentca0ba1f0dc7627d98f02f35cee93488d72087f5a (diff)
use shaded colors for borders
Diffstat (limited to 'src/styleengine.cc')
-rw-r--r--src/styleengine.cc23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/styleengine.cc b/src/styleengine.cc
index a4e42465..79343e88 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -200,19 +200,19 @@ void StyleEngine::apply (StyleAttrs *attrs, CssPropertyList *props) {
break;
case CssProperty::CSS_PROPERTY_BORDER_TOP_COLOR:
attrs->borderColor.top =
- Color::createSimple (layout, p->value.intVal);
+ Color::createShaded (layout, p->value.intVal);
break;
case CssProperty::CSS_PROPERTY_BORDER_BOTTOM_COLOR:
attrs->borderColor.bottom =
- Color::createSimple (layout, p->value.intVal);
+ Color::createShaded (layout, p->value.intVal);
break;
case CssProperty::CSS_PROPERTY_BORDER_LEFT_COLOR:
attrs->borderColor.left =
- Color::createSimple (layout, p->value.intVal);
+ Color::createShaded (layout, p->value.intVal);
break;
case CssProperty::CSS_PROPERTY_BORDER_RIGHT_COLOR:
attrs->borderColor.right =
- Color::createSimple (layout, p->value.intVal);
+ Color::createShaded (layout, p->value.intVal);
break;
case CssProperty::CSS_PROPERTY_BORDER_BOTTOM_STYLE:
attrs->borderStyle.bottom = (BorderStyle) p->value.intVal;
@@ -304,6 +304,21 @@ void StyleEngine::apply (StyleAttrs *attrs, CssPropertyList *props) {
break;
}
}
+
+ /* make sure border colors are set */
+ if (attrs->borderColor.top == NULL)
+ attrs->borderColor.top = Color::createShaded (layout,
+ attrs->color->getColor ());
+ if (attrs->borderColor.bottom == NULL)
+ attrs->borderColor.bottom = Color::createShaded (layout,
+ attrs->color->getColor ());
+ if (attrs->borderColor.left == NULL)
+ attrs->borderColor.left = Color::createShaded (layout,
+ attrs->color->getColor ());
+ if (attrs->borderColor.right == NULL)
+ attrs->borderColor.right = Color::createShaded (layout,
+ attrs->color->getColor ());
+
}
/**