diff options
author | pspjuth <peter.spjuth@gmail.com> | 2001-09-26 20:25:17 (GMT) |
---|---|---|
committer | pspjuth <peter.spjuth@gmail.com> | 2001-09-26 20:25:17 (GMT) |
commit | 05383a493ead1b30256c79a19782ecdbfa74522a (patch) | |
tree | 227a6b7c0cc2662c72aab1116b7d9835ea732809 /generic/tkPack.c | |
parent | ac859f541ab22b0778aa06864848fdf336bb49cf (diff) | |
download | tk-05383a493ead1b30256c79a19782ecdbfa74522a.zip tk-05383a493ead1b30256c79a19782ecdbfa74522a.tar.gz tk-05383a493ead1b30256c79a19782ecdbfa74522a.tar.bz2 |
Geometry manager changes to support TIP#18.
Diffstat (limited to 'generic/tkPack.c')
-rw-r--r-- | generic/tkPack.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/generic/tkPack.c b/generic/tkPack.c index 5ec3496..106b547 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPack.c,v 1.12 2001/09/23 11:30:44 pspjuth Exp $ + * RCS: @(#) $Id: tkPack.c,v 1.13 2001/09/26 20:25:17 pspjuth Exp $ */ #include "tkPort.h" @@ -556,8 +556,6 @@ ArrangePacking(clientData) * allocated to the current window. */ int x, y, width, height; /* These variables are used to hold the * actual geometry of the current window. */ - int intBWidth; /* Width of internal border in parent window, - * if any. */ int abort; /* May get set to non-zero to abort this * repacking operation. */ int borderX, borderY; @@ -609,8 +607,10 @@ ArrangePacking(clientData) * maxHeight - Same as maxWidth, except keeps height info. */ - intBWidth = Tk_InternalBorderWidth(masterPtr->tkwin); - width = height = maxWidth = maxHeight = 2*intBWidth; + width = maxWidth = Tk_InternalBorderLeft(masterPtr->tkwin) + + Tk_InternalBorderRight(masterPtr->tkwin); + height = maxHeight = Tk_InternalBorderTop(masterPtr->tkwin) + + Tk_InternalBorderBottom(masterPtr->tkwin); for (slavePtr = masterPtr->slavePtr; slavePtr != NULL; slavePtr = slavePtr->nextPtr) { if ((slavePtr->side == TOP) || (slavePtr->side == BOTTOM)) { @@ -638,6 +638,13 @@ ArrangePacking(clientData) maxHeight = height; } + if (maxWidth < Tk_MinReqWidth(masterPtr->tkwin)) { + maxWidth = Tk_MinReqWidth(masterPtr->tkwin); + } + if (maxHeight < Tk_MinReqHeight(masterPtr->tkwin)) { + maxHeight = Tk_MinReqHeight(masterPtr->tkwin); + } + /* * If the total amount of space needed in the parent window has * changed, and if we're propagating geometry information, then @@ -666,9 +673,14 @@ ArrangePacking(clientData) * frame, depending on anchor. */ - cavityX = cavityY = x = y = intBWidth; - cavityWidth = Tk_Width(masterPtr->tkwin) - 2*intBWidth; - cavityHeight = Tk_Height(masterPtr->tkwin) - 2*intBWidth; + cavityX = x = Tk_InternalBorderLeft(masterPtr->tkwin); + cavityY = y = Tk_InternalBorderTop(masterPtr->tkwin); + cavityWidth = Tk_Width(masterPtr->tkwin) - + Tk_InternalBorderLeft(masterPtr->tkwin) - + Tk_InternalBorderRight(masterPtr->tkwin); + cavityHeight = Tk_Height(masterPtr->tkwin) - + Tk_InternalBorderTop(masterPtr->tkwin) - + Tk_InternalBorderBottom(masterPtr->tkwin); for (slavePtr = masterPtr->slavePtr; slavePtr != NULL; slavePtr = slavePtr->nextPtr) { if ((slavePtr->side == TOP) || (slavePtr->side == BOTTOM)) { |