import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.BrowserInfo;
int w = Util.getTouchOrMouseClientX(event) - startX + origW;
int h = Util.getTouchOrMouseClientY(event) - startY + origH;
+ w = Math.max(w, getMinWidth());
+ h = Math.max(h, getMinHeight());
+
setWidth(w + "px");
setHeight(h + "px");
}
}
+ private int getMinHeight() {
+ return getPixelValue(getElement().getStyle().getProperty("minHeight"));
+ }
+
+ private int getMinWidth() {
+ return getPixelValue(getElement().getStyle().getProperty("minWidth"));
+ }
+
+ private static int getPixelValue(String size) {
+ if (size == null || !size.endsWith("px")) {
+ return -1;
+ } else {
+ return Integer.parseInt(size.substring(0, size.length() - 2));
+ }
+ }
+
public void updateContentsSize() {
LayoutManager layoutManager = getLayoutManager();
layoutManager.setNeedsMeasure(ConnectorMap.get(client).getConnector(
contentStyle.setPaddingBottom(footerHeight, Unit.PX);
contentStyle.setMarginBottom(-footerHeight, Unit.PX);
+ int minWidth = lm.getOuterWidth(window.header)
+ - lm.getInnerWidth(window.header);
+ int minHeight = footerHeight + headerHeight;
+
+ getWidget().getElement().getStyle().setPropertyPx("minWidth", minWidth);
+ getWidget().getElement().getStyle()
+ .setPropertyPx("minHeight", minHeight);
+
/*
* Must set absolute position if the child has relative height and
* there's a chance of horizontal scrolling as some browsers will