connection.runDescendentsLayout(VView.this);
Util.runWebkitOverflowAutoFix(getElement());
- ensureSubWindowsVisible();
sendClientResized();
}
}
- private void ensureSubWindowsVisible() {
- for (VWindow subWindow : subWindows) {
- // First process width as it might affect the height
- int oldLeft = subWindow.getPopupLeft();
- int oldWidth = subWindow.getOffsetWidth();
- int oldRight = oldLeft + oldWidth;
-
- int newLeft = oldLeft;
-
- if (oldRight > width) {
- newLeft = width - oldWidth;
- if (newLeft < 0) {
- newLeft = 0;
- subWindow.setWidth(width + "px");
- subWindow.updateContentsSize();
- }
- }
-
- // Process height once the width is final
- int oldTop = subWindow.getPopupTop();
- int oldHeight = subWindow.getOffsetHeight();
- int oldBottom = oldTop + oldHeight;
-
- int newTop = oldTop;
-
- if (oldBottom > height) {
- newTop = height - oldHeight;
- if (newTop < 0) {
- newTop = 0;
- subWindow.setHeight(height + "px");
- subWindow.updateContentsSize();
- }
- }
-
- subWindow.setPopupPosition(newLeft, newTop);
- }
-
- }
-
public String getTheme() {
return theme;
}