aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-11-11 18:50:12 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-11-11 18:50:12 +0100
commit5f5e3153376396298baaf364b5741160d3543e79 (patch)
tree20a43cef4bb21eee732be16d2f9175f02afd8bb6 /src
parent718357224eff5bba9557a17813d0a28e09d93552 (diff)
support margin
Diffstat (limited to 'src')
-rw-r--r--src/css.cc4
-rw-r--r--src/css.hh1
-rw-r--r--src/styleengine.cc3
3 files changed, 8 insertions, 0 deletions
diff --git a/src/css.cc b/src/css.cc
index aa393c97..d8b48a46 100644
--- a/src/css.cc
+++ b/src/css.cc
@@ -10,6 +10,7 @@
*/
#include <stdio.h>
+#include <math.h>
#include "prefs.h"
#include "html_common.hh"
#include "css.hh"
@@ -121,6 +122,7 @@ CssStyleSheet * CssContext::buildUserAgentStyle () {
props->set (CssProperty::CSS_PROPERTY_BACKGROUND_COLOR, 0xdcd1ba);
props->set (CssProperty::CSS_PROPERTY_FONT_FAMILY, "DejaVu Sans");
props->set (CssProperty::CSS_PROPERTY_COLOR, 0x000000);
+ props->set (CssProperty::CSS_PROPERTY_MARGIN, 5);
s->addRule (new CssSelector(a_Html_tag_index("body"), NULL, NULL), props);
// :link
@@ -216,6 +218,8 @@ CssStyleSheet * CssContext::buildUserStyle (bool important) {
props = new CssPropertyList ();
props->set (CssProperty::CSS_PROPERTY_BACKGROUND_COLOR, prefs.bg_color);
props->set (CssProperty::CSS_PROPERTY_FONT_FAMILY, prefs.vw_fontname);
+ props->set (CssProperty::CSS_PROPERTY_FONT_SIZE,
+ (int) rint(14.0 * prefs.font_factor));
props->set (CssProperty::CSS_PROPERTY_COLOR, prefs.text_color);
s->addRule (new CssSelector(a_Html_tag_index("body"), NULL, NULL), props);
diff --git a/src/css.hh b/src/css.hh
index 2eb7f114..017a2fc2 100644
--- a/src/css.hh
+++ b/src/css.hh
@@ -62,6 +62,7 @@ class CssProperty {
CSS_PROPERTY_LIST_STYLE_IMAGE,
CSS_PROPERTY_LIST_STYLE_POSITION,
CSS_PROPERTY_LIST_STYLE_TYPE,
+ CSS_PROPERTY_MARGIN,
CSS_PROPERTY_MARGIN_BOTTOM,
CSS_PROPERTY_MARGIN_LEFT,
CSS_PROPERTY_MARGIN_RIGHT,
diff --git a/src/styleengine.cc b/src/styleengine.cc
index 9a08c03a..e43d9171 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -167,6 +167,9 @@ void StyleEngine::apply (StyleAttrs *attrs, CssPropertyList *props) {
case CssProperty::CSS_PROPERTY_LIST_STYLE_TYPE:
attrs->listStyleType = (ListStyleType) p->value.intVal;
break;
+ case CssProperty::CSS_PROPERTY_MARGIN:
+ attrs->margin.setVal (p->value.intVal);
+ break;
case CssProperty::CSS_PROPERTY_PADDING:
attrs->padding.setVal (p->value.intVal);
break;