comparison mde/gui/widget/miscContent.d @ 140:c94ec5594449

Fixed a bug with changing the minimal size and optimised it slightly.
author Diggory Hardy <diggory.hardy@gmail.com>
date Sun, 08 Feb 2009 15:20:11 +0000
parents 9f035cd139c6
children 2ac3e0012788
comparison
equal deleted inserted replaced
139:29a524e7c858 140:c94ec5594449
181 currentW = subWidgets[content()]; 181 currentW = subWidgets[content()];
182 mw = currentW.minWidth; 182 mw = currentW.minWidth;
183 mh = currentW.minHeight; 183 mh = currentW.minHeight;
184 parent.minWChange (this, mw); 184 parent.minWChange (this, mw);
185 parent.minHChange (this, mh); 185 parent.minHChange (this, mh);
186 // If resizable and already large enough, don't resize; else do. 186 // Parent may change size. If it doesn't, we must set child's size.
187 if (isWS && w > mw) currentW.setWidth (w, -1); 187 // We can't tell if it did, so do it (call will be fast if size isn't
188 else w = currentW.width; 188 // changed anyway).
189 if (isHS && h > mh) currentW.setHeight (h, -1); 189 currentW.setWidth (w, -1);
190 else h = currentW.height; 190 currentW.setHeight (h, -1);
191 currentW.setPosition (x,y); 191 currentW.setPosition (x,y);
192 } 192 }
193 193
194 IChildWidget currentW; 194 IChildWidget currentW;
195 EnumContent content; 195 EnumContent content;