aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dw/fltkimgbuf.cc2
-rw-r--r--dw/widget.cc37
-rw-r--r--dw/widget.hh3
3 files changed, 39 insertions, 3 deletions
diff --git a/dw/fltkimgbuf.cc b/dw/fltkimgbuf.cc
index 01bce455..9037c19c 100644
--- a/dw/fltkimgbuf.cc
+++ b/dw/fltkimgbuf.cc
@@ -35,7 +35,7 @@ namespace fltk {
using namespace lout::container::typed;
const enum ScaleMode { SIMPLE, BEAUTIFUL, BEAUTIFUL_GAMMA }
- scaleMode = BEAUTIFUL_GAMMA;
+ scaleMode = SIMPLE;
Vector <FltkImgbuf::GammaCorrectionTable> *FltkImgbuf::gammaCorrectionTables
= new Vector <FltkImgbuf::GammaCorrectionTable> (true, 2);
diff --git a/dw/widget.cc b/dw/widget.cc
index 0e44dbdf..7fa87d1d 100644
--- a/dw/widget.cc
+++ b/dw/widget.cc
@@ -439,11 +439,38 @@ void Widget::correctRequisition (Requisition *requisition,
} else
container->correctRequisitionOfChild (this, requisition, splitHeightFun);
- DBG_OBJ_MSGF ("resize", 1, "=> %d * (%d + %d)",
+ DBG_OBJ_MSGF ("resize", 1, "=> %d * (%d + %d)",
requisition->width, requisition->ascent,
requisition->descent);
+ DBG_OBJ_MSG_END ();
+}
+
+void Widget::correctExtremes (Extremes *extremes)
+{
+ // TODO Extremes only corrected?
+
+ DBG_OBJ_MSGF ("resize", 0, "<b>correctExtremes</b> (%d / %d)"
+ extremes->minWidth, extremes->maxWidth);
+ DBG_OBJ_MSG_START ();
+
+ if (container == NULL) {
+ if (core::style::isAbsLength (getStyle()->width))
+ // TODO What does "width" exactly stand for? (Content or all?)
+ extremes->minWidth = extremes->maxWidth =
+ core::style::absLengthVal (getStyle()->width);
+ else if (core::style::isPerLength (getStyle()->width)) {
+ int viewportWidth =
+ layout->viewportWidth - (layout->canvasHeightGreater ?
+ layout->vScrollbarThickness : 0);
+ extremes->minWidth = extremes->maxWidth =
+ style::multiplyWithPerLength (viewportWidth, getStyle()->width);
+ }
+ } else
+ container->correctExtremesOfChild (this, extremes);
+
+ DBG_OBJ_MSGF ("resize", 1, "=> %d / %d",
+ extremes->minWidth, extremes->maxWidth);
DBG_OBJ_MSG_END ();
-
}
/**
@@ -946,6 +973,12 @@ void Widget::correctRequisitionOfChild (Widget *child, Requisition *requisition,
misc::assertNotReached ();
}
+void correctExtremesOfChild (Widget *child, Extremes *extremes)
+{
+ // Must be implemented for possible containers.
+ misc::assertNotReached ();
+}
+
/**
* \brief This method is called after a widget has been set as the top of a
* widget tree.
diff --git a/dw/widget.hh b/dw/widget.hh
index 3b2a01de..326d00ec 100644
--- a/dw/widget.hh
+++ b/dw/widget.hh
@@ -320,6 +320,8 @@ protected:
int *ascent,
int
*descent));
+ virtual void correctExtremesOfChild (Widget *child, Extremes *extremes);
+
virtual void notifySetAsTopLevel();
virtual void notifySetParent();
@@ -437,6 +439,7 @@ public:
void correctRequisition (Requisition *requisition,
void (*splitHeightFun)(int height, int *ascent,
int *descent));
+ void correctExtremes (Extremes *extremes);
virtual bool isBlockLevel ();
virtual bool isPossibleContainer ();