summaryrefslogtreecommitdiff
path: root/src/styleengine.hh
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2024-06-09 21:52:14 +0200
committerRodrigo Arias Mallo <rodarima@gmail.com>2024-06-25 20:45:21 +0200
commit06f9083bdeb085b7b9de762fa029f6519e142dbe (patch)
treeb3efca1e52e04f11a2087696d643d3ccfb84993d /src/styleengine.hh
parent52d9a4726da51b78bc5ed445588efb17f5f4e637 (diff)
Add support for zoom factor
Allows zooming in and out of pages by changing the size of all elements, including font size, images and tables. The initial zoom is specified in the "zoom_factor" option of dillorc. Use the new shortcuts Ctrl+ and Ctrl- to adjust the zoom of the current page and Ctrl 0 to reset it to 100%. When a new tab or window is opened, the current zoom factor is inherited. Each tab retains its own zoom factor. Fixes: https://github.com/dillo-browser/dillo/issues/21
Diffstat (limited to 'src/styleengine.hh')
-rw-r--r--src/styleengine.hh15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/styleengine.hh b/src/styleengine.hh
index db3e3b85..9a78869b 100644
--- a/src/styleengine.hh
+++ b/src/styleengine.hh
@@ -1,3 +1,15 @@
+/*
+ * File: styleengine.hh
+ *
+ * Copyright 2008-2009 Johannes Hofmann <Johannes.Hofmann@gmx.de>
+ * Copyright 2024 Rodrigo Arias Mallo <rodarima@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ */
+
#ifndef __STYLEENGINE_HH__
#define __STYLEENGINE_HH__
@@ -37,6 +49,7 @@ class StyleEngine {
Doctree *doctree;
int importDepth;
float dpmm;
+ float zoom;
DilloUrl *pageUrl, *baseUrl;
void stackPush ();
@@ -69,7 +82,7 @@ class StyleEngine {
static void init ();
StyleEngine (dw::core::Layout *layout,
- const DilloUrl *pageUrl, const DilloUrl *baseUrl);
+ const DilloUrl *pageUrl, const DilloUrl *baseUrl, float zoom);
~StyleEngine ();
void parse (DilloHtml *html, DilloUrl *url, const char *buf, int buflen,