diff mde/gui/widget/ParentContent.d @ 179:1f9d00f392bd default tip

Fixed a bug where (non-resizible) widgets wouldn't get shrunk when minimal size decreases, meaning optional context menus are hiden properly now. Optimised when ServiceContentList.opCall is called, I think without breaking anything.
author Diggory Hardy <diggory.hardy@gmail.com>
date Tue, 15 Sep 2009 20:09:59 +0200
parents af40e9679436
children
line wrap: on
line diff
--- a/mde/gui/widget/ParentContent.d	Tue Sep 15 10:36:37 2009 +0200
+++ b/mde/gui/widget/ParentContent.d	Tue Sep 15 20:09:59 2009 +0200
@@ -208,7 +208,7 @@
 	    mw = nmw;
 	    parent.minWChange (this, nmw);
 	} else {	// changes won't be seen, but we must follow function spec
-	    if (widget.width < nmw)
+	    if (!widget.isWSizable || widget.width < nmw)
 		widget.setWidth (nmw, -1);
 	}
     }
@@ -217,7 +217,7 @@
 	    mh = nmh;
 	    parent.minHChange (this, nmh);
 	} else {
-	    if (widget.height < nmh)
+	    if (!widget.isHSizable || widget.height < nmh)
 		widget.setHeight (nmh, -1);
 	}
     }
@@ -336,7 +336,7 @@
 	    super.minWChange (widget, nmw);
     }
     override void minHChange (IChildWidget widget, wdim nmh) {
-        debug assert (widget is subWidgets[0]);
+	debug assert (widget is subWidgets[0]);
 	if (display) {
 	    mh = nmh;
 	    parent.minHChange (this, nmh);
@@ -386,8 +386,7 @@
     void cbDisplay (IContent) {
 	if (display == content_()) return;
         display = content_();
-	logger.trace ("{}.cbDisplay ({})", id, display);
-        if (display) {
+	if (display) {
             mw = subWidgets[0].minWidth;
             mh = subWidgets[0].minHeight;
         } else {
@@ -395,7 +394,7 @@
         }
         parent.minWChange (this, mw);
         parent.minHChange (this, mh);
-        if (!display) return;
+	if (!display) return;
     	// set incase parent didn't:
         subWidgets[0].setWidth (w, -1);
         subWidgets[0].setHeight (h, -1);