aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-02-17 10:22:06 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-02-17 10:22:06 +0100
commitf439ac9b889ce757133f8cb5d261381190e2065f (patch)
tree8e8df1533bc1f273e1a523ec3ff8c7c5b4b270f3
parent4c303cba1745f13057ccbc9c21eaeb44fe955efe (diff)
add font_max_size dillorc option
-rw-r--r--ChangeLog2
-rw-r--r--dillorc3
-rw-r--r--src/prefs.c2
-rw-r--r--src/prefs.h1
-rw-r--r--src/styleengine.cc4
5 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 12c5c4e3..7f757c6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -59,7 +59,7 @@ dillo-2.1
- Improved CSS selector matching performance using hash tables.
- Support selector specificity.
- Add support for font-size and font-weight enum values.
- - Added "font_min_size" dillorc option.
+ - Added "font_max_size", "font_min_size" dillorc options.
Patches: Johannes Hofmann
+- Implemented a close-tab button for the GUI.
Patch: João Ricardo Lourenço, Jorge Arellano Cid
diff --git a/dillorc b/dillorc
index 66c285d6..0162d09b 100644
--- a/dillorc
+++ b/dillorc
@@ -53,6 +53,9 @@
# font_factor=1.5
#font_factor=1.0
+# Maximum font size in pixels
+#font_max_size=100
+
# Minimum font size in pixels
#font_min_size=6
diff --git a/src/prefs.c b/src/prefs.c
index 6167085c..3fd1d0ec 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -163,6 +163,7 @@ static int Prefs_parse_dillorc(void)
{ "font_cursive", &prefs.font_cursive, PREFS_STRING },
{ "font_factor", &prefs.font_factor, PREFS_DOUBLE },
{ "font_fantasy", &prefs.font_fantasy, PREFS_STRING },
+ { "font_max_size", &prefs.font_max_size, PREFS_INT32 },
{ "font_min_size", &prefs.font_min_size, PREFS_INT32 },
{ "font_monospace", &prefs.font_monospace, PREFS_STRING },
{ "font_sans_serif", &prefs.font_sans_serif, PREFS_STRING },
@@ -268,6 +269,7 @@ void a_Prefs_init(void)
prefs.focus_new_tab = TRUE;
prefs.font_cursive = dStrdup(D_FONT_CURSIVE);
prefs.font_factor = 1.0;
+ prefs.font_max_size = 100;
prefs.font_min_size = 6;
prefs.font_fantasy = dStrdup(D_FONT_FANTASY);
prefs.font_monospace = dStrdup(D_FONT_MONOSPACE);
diff --git a/src/prefs.h b/src/prefs.h
index f4c70bb1..a50b5585 100644
--- a/src/prefs.h
+++ b/src/prefs.h
@@ -44,6 +44,7 @@ struct _DilloPrefs {
bool_t w3c_plus_heuristics;
bool_t focus_new_tab;
double font_factor;
+ int32_t font_max_size;
int32_t font_min_size;
bool_t show_back;
bool_t show_forw;
diff --git a/src/styleengine.cc b/src/styleengine.cc
index 5939547b..5c6f0972 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -34,6 +34,8 @@ StyleEngine::StyleEngine (dw::core::Layout *layout) {
font_attrs.size = (int) (14 * prefs.font_factor + 0.5);
if (font_attrs.size < prefs.font_min_size)
font_attrs.size = prefs.font_min_size;
+ if (font_attrs.size > prefs.font_max_size)
+ font_attrs.size = prefs.font_max_size;
font_attrs.weight = 400;
font_attrs.style = FONT_STYLE_NORMAL;
@@ -231,6 +233,8 @@ void StyleEngine::apply (StyleAttrs *attrs, CssPropertyList *props) {
if (fontAttrs.size < prefs.font_min_size)
fontAttrs.size = prefs.font_min_size;
+ if (fontAttrs.size > prefs.font_max_size)
+ fontAttrs.size = prefs.font_max_size;
break;
case CSS_PROPERTY_FONT_STYLE: