aboutsummaryrefslogtreecommitdiff
path: root/dw/widget.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dw/widget.cc')
-rw-r--r--dw/widget.cc23
1 files changed, 16 insertions, 7 deletions
diff --git a/dw/widget.cc b/dw/widget.cc
index 202e6556..d63d1edc 100644
--- a/dw/widget.cc
+++ b/dw/widget.cc
@@ -586,7 +586,7 @@ void Widget::sizeRequest (Requisition *requisition, int numPos,
}
if (needsResize ()) {
- calcExtraSpace ();
+ calcExtraSpace (true);
/** \todo Check requisition == &(this->requisition) and do what? */
sizeRequestImpl (requisition, numPos, references, x, y);
this->requisition = *requisition;
@@ -1007,7 +1007,7 @@ void Widget::getExtremes (Extremes *extremes, int numPos, Widget **references,
}
if (extremesChanged ()) {
- calcExtraSpace ();
+ calcExtraSpace (false);
// For backward compatibility (part 1/2):
extremes->minWidthIntrinsic = extremes->maxWidthIntrinsic = -1;
@@ -1043,16 +1043,22 @@ void Widget::getExtremes (Extremes *extremes, int numPos, Widget **references,
*
* Delegated to dw::core::Widget::calcExtraSpaceImpl. Called both from
* dw::core::Widget::sizeRequest and dw::core::Widget::getExtremes.
+ *
+ * If `vertical` is false, only horizontal dimensions are calculated. (This is
+ * used for extremes.)
*/
-void Widget::calcExtraSpace ()
+void Widget::calcExtraSpace (bool vertical)
{
DBG_OBJ_ENTER0 ("resize", 0, "calcExtraSpace");
extraSpace.top = extraSpace.right = extraSpace.bottom = extraSpace.left = 0;
- calcExtraSpaceImpl ();
+ calcExtraSpaceImpl (vertical);
- DBG_OBJ_SET_NUM ("extraSpace.top", extraSpace.top);
- DBG_OBJ_SET_NUM ("extraSpace.bottom", extraSpace.bottom);
+ if (vertical) {
+ DBG_OBJ_SET_NUM ("extraSpace.top", extraSpace.top);
+ DBG_OBJ_SET_NUM ("extraSpace.bottom", extraSpace.bottom);
+ }
+
DBG_OBJ_SET_NUM ("extraSpace.left", extraSpace.left);
DBG_OBJ_SET_NUM ("extraSpace.right", extraSpace.right);
@@ -1602,8 +1608,11 @@ void Widget::sizeAllocateImpl (Allocation *allocation)
* dw::core::Widget::extraSpace, which is only corrected. To make sure
* all possible influences are considered, the implementation of the
* base class should be called, too.
+ *
+ * If `vertical` is false, only horizontal dimensions are calculated. (This is
+ * used for extremes.)
*/
-void Widget::calcExtraSpaceImpl ()
+void Widget::calcExtraSpaceImpl (bool vertical)
{
}