aboutsummaryrefslogtreecommitdiff
path: root/src/plain.cc
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-03-06 10:09:38 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-03-06 10:09:38 +0100
commit620bd1c02fb87eb424819e4daf1482da29fb727e (patch)
treedc8c4e83d697e5a033dd7c1cf9c464513a0e3a44 /src/plain.cc
parent9514cc5f1a0bc7e8ba63791edd62d2d9e69821f8 (diff)
remove bg_color dillorc option
To set a custom background color add a line like: body {background-color: white} to your ~/.dillo/style.css file. This also works for plain text display and image viewing.
Diffstat (limited to 'src/plain.cc')
-rw-r--r--src/plain.cc24
1 files changed, 7 insertions, 17 deletions
diff --git a/src/plain.cc b/src/plain.cc
index 5366f87e..5111912a 100644
--- a/src/plain.cc
+++ b/src/plain.cc
@@ -22,6 +22,7 @@
#include "bw.h"
#include "web.hh"
#include "misc.h"
+#include "styleengine.hh"
#include "uicmd.hh"
@@ -85,9 +86,6 @@ void a_Plain_free(void *data);
*/
DilloPlain::DilloPlain(BrowserWindow *p_bw, const DilloUrl *p_url)
{
- style::StyleAttrs styleAttrs;
- style::FontAttrs fontAttrs;
-
/* Init event receiver */
plainReceiver.plain = this;
@@ -98,20 +96,12 @@ DilloPlain::DilloPlain(BrowserWindow *p_bw, const DilloUrl *p_url)
Start_Ofs = 0;
state = ST_SeekingEol;
- /* Create the font and attribute for the page. */
- fontAttrs.name = prefs.font_monospace;
- fontAttrs.size = (int) rint(14.0 * prefs.font_factor);
- fontAttrs.weight = 400;
- fontAttrs.style = style::FONT_STYLE_NORMAL;
-
- Layout *layout = (Layout*)bw->render_layout;
- styleAttrs.initValues ();
- styleAttrs.margin.setVal (5);
- styleAttrs.font = style::Font::create (layout, &fontAttrs);
- styleAttrs.color = style::Color::create (layout, prefs.text_color);
- styleAttrs.backgroundColor =
- style::Color::create (layout, prefs.bg_color);
- widgetStyle = style::Style::create (layout, &styleAttrs);
+ StyleEngine styleEngine ((Layout*)bw->render_layout);
+
+ styleEngine.startElement ("body");
+ styleEngine.startElement ("pre");
+ widgetStyle = styleEngine.wordStyle ();
+ widgetStyle->ref ();
/* The context menu */
DW2TB(dw)->connectEvent (&plainReceiver);