aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-07-21 22:22:54 +0200
committerSebastian Geerken <devnull@localhost>2014-07-21 22:22:54 +0200
commit0a6fc284229b0fa4bb567ad26d76bff01a62a01b (patch)
treeb3f848b4036cd48fd6dd91fd7887aa2b09432199
parent26e47e9cef47b3e65087c88a303666e5a81b49b1 (diff)
New dillorc option adjust_table_min_width.
-rw-r--r--ChangeLog2
-rw-r--r--dillorc8
-rw-r--r--dw/table.cc1
-rw-r--r--dw/table.hh8
-rw-r--r--dw/widget.cc2
-rw-r--r--dw/widget.hh2
-rw-r--r--src/dillo.cc2
-rw-r--r--src/prefs.c1
-rw-r--r--src/prefs.h1
-rw-r--r--src/prefsparser.cc1
10 files changed, 23 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 285ad801..4f5b5182 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,7 +14,7 @@ dillo_grows [to be integrated after merge]
supported.
- Image aspect ratio is preserved when one dimension is specified by a
percentage value.
- - New dillorc option 'adjust_min_width'.
+ - New dillorc options 'adjust_min_width' and 'adjust_table_min_width'.
Patches: Sebastian Geerken
diff --git a/dillorc b/dillorc
index 1260c28a..ad688258 100644
--- a/dillorc
+++ b/dillorc
@@ -80,9 +80,15 @@
#limit_text_width=NO
# If this is set to YES, all CSS size specifications are adjusted so that
-# all contents can be displayed.
+# all contents can be displayed. (Except for tables, see below.)
#adjust_min_width=NO
+# If this is set to YES, all CSS size specifications for tables are
+# adjusted so that all contents can be displayed. This is seperated
+# from "adjust_min_width" (with another standard value) to mimic
+# Firefox, which differenciates between tables and, say, textblocks.
+#adjust_table_min_width=YES
+
#-------------------------------------------------------------------------
# PENALTIES
#-------------------------------------------------------------------------
diff --git a/dw/table.cc b/dw/table.cc
index 5df366a4..6b3ae804 100644
--- a/dw/table.cc
+++ b/dw/table.cc
@@ -28,6 +28,7 @@ using namespace lout;
namespace dw {
+bool Table::adjustTableMinWidth = true;
int Table::CLASS_ID = -1;
Table::Table(bool limitTextWidth)
diff --git a/dw/table.hh b/dw/table.hh
index 96769f40..109bbf30 100644
--- a/dw/table.hh
+++ b/dw/table.hh
@@ -322,7 +322,6 @@ namespace dw {
class Table: public core::Widget
{
private:
-
struct Child
{
enum {
@@ -361,6 +360,8 @@ private:
friend class TableIterator;
+ static bool adjustTableMinWidth;
+
bool limitTextWidth, rowClosed;
int numRows, numCols, curRow, curCol;
@@ -463,6 +464,8 @@ protected:
void sizeAllocateImpl (core::Allocation *allocation);
void resizeDrawImpl ();
+ bool getAdjustMinWidth () { return Table::adjustTableMinWidth; }
+
int getAvailWidthOfChild (Widget *child, bool forceValue);
void correctRequisitionOfChild (core::Widget *child,
core::Requisition *requisition,
@@ -485,6 +488,9 @@ protected:
public:
static int CLASS_ID;
+ inline static void setAdjustTableMinWidth (bool adjustTableMinWidth)
+ { Table::adjustTableMinWidth = adjustTableMinWidth; }
+
Table(bool limitTextWidth);
~Table();
diff --git a/dw/widget.cc b/dw/widget.cc
index 362dc56e..5620ebdb 100644
--- a/dw/widget.cc
+++ b/dw/widget.cc
@@ -524,7 +524,7 @@ int Widget::getMinWidth (Extremes *extremes, bool forceValue)
forceValue ? "true" : "false");
int minWidth;
- if (adjustMinWidth) {
+ if (getAdjustMinWidth ()) {
Extremes extremes2;
if (extremes == NULL) {
if (forceValue) {
diff --git a/dw/widget.hh b/dw/widget.hh
index 4aa8d5de..d6251f4f 100644
--- a/dw/widget.hh
+++ b/dw/widget.hh
@@ -389,7 +389,6 @@ public:
inline static void setAdjustMinWidth (bool adjustMinWidth)
{ Widget::adjustMinWidth = adjustMinWidth; }
- inline static bool getAdjustMinWidth () { return Widget::adjustMinWidth; }
Widget ();
~Widget ();
@@ -428,6 +427,7 @@ public:
int getAvailWidth (bool forceValue);
int getAvailHeight (bool forceValue);
+ virtual bool getAdjustMinWidth () { return Widget::adjustMinWidth; }
void correctRequisition (Requisition *requisition,
void (*splitHeightFun) (int, int*, int*));
void correctExtremes (Extremes *extremes);
diff --git a/src/dillo.cc b/src/dillo.cc
index d67ba3af..90eecdd7 100644
--- a/src/dillo.cc
+++ b/src/dillo.cc
@@ -58,6 +58,7 @@
#include "dw/fltkcore.hh"
#include "dw/widget.hh"
#include "dw/textblock.hh"
+#include "dw/table.hh"
/*
* Command line options structure
@@ -485,6 +486,7 @@ int main(int argc, char **argv)
StyleEngine::init();
dw::core::Widget::setAdjustMinWidth (prefs.adjust_min_width);
+ dw::Table::setAdjustTableMinWidth (prefs.adjust_table_min_width);
dw::Textblock::setPenaltyHyphen (prefs.penalty_hyphen);
dw::Textblock::setPenaltyHyphen2 (prefs.penalty_hyphen_2);
dw::Textblock::setPenaltyEmDashLeft (prefs.penalty_em_dash_left);
diff --git a/src/prefs.c b/src/prefs.c
index b0213fcc..67cbaa79 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -69,6 +69,7 @@ void a_Prefs_init(void)
prefs.http_user_agent = dStrdup(PREFS_HTTP_USER_AGENT);
prefs.limit_text_width = FALSE;
prefs.adjust_min_width = FALSE;
+ prefs.adjust_table_min_width = TRUE;
prefs.load_images=TRUE;
prefs.load_background_images=FALSE;
prefs.load_stylesheets=TRUE;
diff --git a/src/prefs.h b/src/prefs.h
index b742e6e7..ac52786e 100644
--- a/src/prefs.h
+++ b/src/prefs.h
@@ -67,6 +67,7 @@ typedef struct {
bool_t small_icons;
bool_t limit_text_width;
bool_t adjust_min_width;
+ bool_t adjust_table_min_width;
bool_t w3c_plus_heuristics;
bool_t focus_new_tab;
double font_factor;
diff --git a/src/prefsparser.cc b/src/prefsparser.cc
index 33f6cf51..d54d017b 100644
--- a/src/prefsparser.cc
+++ b/src/prefsparser.cc
@@ -80,6 +80,7 @@ int PrefsParser::parseOption(char *name, char *value)
{ "http_user_agent", &prefs.http_user_agent, PREFS_STRING },
{ "limit_text_width", &prefs.limit_text_width, PREFS_BOOL },
{ "adjust_min_width", &prefs.adjust_min_width, PREFS_BOOL },
+ { "adjust_table_min_width", &prefs.adjust_table_min_width, PREFS_BOOL },
{ "load_images", &prefs.load_images, PREFS_BOOL },
{ "load_background_images", &prefs.load_background_images, PREFS_BOOL },
{ "load_stylesheets", &prefs.load_stylesheets, PREFS_BOOL },