Revision: 7226
Author: [email protected]
Date: Tue Dec  1 16:25:52 2009
Log: Fixes issues 2907, 4277 and 4278.
Also fixes mail icon showing up in front of the about dialog.
Review: http://gwt-code-reviews.appspot.com/113801
http://code.google.com/p/google-web-toolkit/source/detail?r=7226

Modified:
  /trunk/samples/mail/src/com/google/gwt/sample/mail/client/global.css
  /trunk/user/src/com/google/gwt/user/client/ui/PopupPanel.java
  /trunk/user/src/com/google/gwt/user/client/ui/impl/PopupImpl.java
  /trunk/user/src/com/google/gwt/user/client/ui/impl/PopupImplIE6.java
  /trunk/user/src/com/google/gwt/user/client/ui/impl/PopupImplMozilla.java
   
/trunk/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome.css
   
/trunk/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome_rtl.css
  /trunk/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark.css
  /trunk/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark_rtl.css
   
/trunk/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard.css
   
/trunk/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard_rtl.css

=======================================
--- /trunk/samples/mail/src/com/google/gwt/sample/mail/client/global.css        
 
Tue Nov 24 14:14:51 2009
+++ /trunk/samples/mail/src/com/google/gwt/sample/mail/client/global.css        
 
Tue Dec  1 16:25:52 2009
@@ -18,6 +18,7 @@
  .gwt-DialogBox {
    background-color: white;
    border: 1px solid #666;
+  z-index: 2;
  }
  .gwt-DialogBox .Caption {
    background: #d3d6dd url(gradient_bg_th.png) repeat-x bottom left;
@@ -33,10 +34,11 @@
  .gwt-DialogBox .gwt-Button {
    margin: 10px;
  }
-.gwt-PopupGlass {
+.gwt-PopupPanelGlass {
    background-color: #000;
    opacity: 0.3;
    filter: literal("alpha(opacity=30)");
+  z-index: 2;
  }

  /* GWT Tree */
=======================================
--- /trunk/user/src/com/google/gwt/user/client/ui/PopupPanel.java       Thu Nov 
  
5 11:48:25 2009
+++ /trunk/user/src/com/google/gwt/user/client/ui/PopupPanel.java       Tue Dec 
  
1 16:25:52 2009
@@ -63,6 +63,14 @@
   * <img class='gallery' src='PopupPanel.png'/>
   * </p>
   *
+ * <p>
+ * The PopupPanel can be optionally displayed with a "glass" element  
behind it,
+ * which is commonly used to gray out the widgets behind it. It can be  
enabled
+ * using {...@link #setGlassEnabled(boolean)}. It has a default style name of
+ * "gwt-PopupPanelGlass", which can be changed using
+ * {...@link #setGlassStyleName()}.
+ * </p>
+ *
   * <p>
   * <h3>Example</h3>
   * {...@example com.google.gwt.examples.PopupPanelExample}
@@ -73,7 +81,7 @@
   * <dd>the outside of the popup</dd>
   * <dt>.gwt-PopupPanel .popupContent</dt>
   * <dd>the wrapper around the content</dd>
- * <dt>.gwt-PopupGlass</dt>
+ * <dt>.gwt-PopupPanelGlass</dt>
   * <dd>the glass background behind the popup</dd>
   * </dl>
   */
@@ -267,6 +275,7 @@
        if (showing) {
          if (curPanel.isGlassEnabled) {
            Document.get().getBody().appendChild(curPanel.glass);
+          impl.onShow(curPanel.glass);
            glassShowing = true;

            Window.addResizeHandler(curPanel.glassResizer);
@@ -274,6 +283,7 @@
          }
        } else if (glassShowing) {
          Document.get().getBody().removeChild(curPanel.glass);
+        impl.onHide(curPanel.glass);
          glassShowing = false;
        }
      }
@@ -360,6 +370,8 @@
     */
    private Element glass;

+  private String glassStyleName = "gwt-PopupPanelGlass";
+
    /**
     * A boolean indicating that a glass element should be used.
     */
@@ -386,7 +398,7 @@
     */
    public PopupPanel() {
      super();
-    DOM.appendChild(super.getContainerElement(), impl.createElement());
+    super.getContainerElement().appendChild(impl.createElement());

      // Default position of popup should be in the upper-left corner of the
      // window. By setting a default position, the popup will not appear in
@@ -478,6 +490,16 @@
        }
      }
    }
+
+  /**
+   * Gets the style name to be used on the glass element. By default, this  
is
+   * "gwt-PopupPanelGlass".
+   *
+   * @return the glass element's style name
+   */
+  public String getGlassStyleName() {
+    return glassStyleName;
+  }

    /**
     * Gets the panel's offset height in pixels. Calls to
@@ -681,7 +703,7 @@
        autoHidePartners.remove(partner);
      }
    }
-
+
    /**
     * @deprecated Use the {...@link HandlerRegistration#removeHandler} method  
on the
     *             object returned by {...@link #addCloseHandler} instead
@@ -716,13 +738,26 @@
      this.isGlassEnabled = enabled;
      if (enabled && glass == null) {
        glass = Document.get().createDivElement();
-      glass.setClassName("gwt-PopupGlass");
+      glass.setClassName(glassStyleName);

        glass.getStyle().setPosition(Position.ABSOLUTE);
        glass.getStyle().setLeft(0, Unit.PX);
        glass.getStyle().setTop(0, Unit.PX);
      }
    }
+
+  /**
+   * Sets the style name to be used on the glass element. By default, this  
is
+   * "gwt-PopupPanelGlass".
+   *
+   * @param glassStyleName the glass element's style name
+   */
+  public void setGlassStyleName(String glassStyleName) {
+    this.glassStyleName = glassStyleName;
+    if (glass != null) {
+      glass.setClassName(glassStyleName);
+    }
+  }

    /**
     * Sets the height of the panel's child widget. If the panel's child  
widget
@@ -850,6 +885,9 @@
      // If the PopupImpl creates an iframe shim, it's also necessary to  
hide it
      // as well.
      impl.setVisible(getElement(), visible);
+    if (glass != null) {
+      impl.setVisible(glass, visible);
+    }
    }

    @Override
@@ -914,7 +952,7 @@

    @Override
    protected com.google.gwt.user.client.Element getContainerElement() {
-    return impl.getContainerElement(getPopupImplElement());
+    return impl.getContainerElement(getPopupImplElement()).cast();
    }

    /**
@@ -929,7 +967,7 @@

    @Override
    protected com.google.gwt.user.client.Element getStyleElement() {
-    return impl.getStyleElement(getPopupImplElement());
+    return impl.getStyleElement(getPopupImplElement()).cast();
    }

    protected void onPreviewNativeEvent(NativePreviewEvent event) {
=======================================
--- /trunk/user/src/com/google/gwt/user/client/ui/impl/PopupImpl.java   Mon  
Oct 26 14:02:26 2009
+++ /trunk/user/src/com/google/gwt/user/client/ui/impl/PopupImpl.java   Tue  
Dec  1 16:25:52 2009
@@ -15,8 +15,8 @@
   */
  package com.google.gwt.user.client.ui.impl;

-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
+import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;

  /**
   * Implementation class used by {...@link  
com.google.gwt.user.client.ui.PopupPanel}.
@@ -24,7 +24,7 @@
  public class PopupImpl {

    public Element createElement() {
-    return DOM.createDiv();
+    return Document.get().createDivElement();
    }

    public Element getContainerElement(Element popup) {
@@ -32,7 +32,7 @@
    }

    public Element getStyleElement(Element popup) {
-    return DOM.getParent(popup);
+    return popup.getParentElement();
    }

    /**
@@ -52,7 +52,7 @@
     * @param rect the clip rect
     */
    public void setClip(Element popup, String rect) {
-    DOM.setStyleAttribute(popup, "clip", rect);
+    popup.getStyle().setProperty("clip", rect);
    }

    /**
=======================================
--- /trunk/user/src/com/google/gwt/user/client/ui/impl/PopupImplIE6.java        
 
Mon Jul 14 16:21:15 2008
+++ /trunk/user/src/com/google/gwt/user/client/ui/impl/PopupImplIE6.java        
 
Tue Dec  1 16:25:52 2009
@@ -15,7 +15,7 @@
   */
  package com.google.gwt.user.client.ui.impl;

-import com.google.gwt.user.client.Element;
+import com.google.gwt.dom.client.Element;

  /**
   * Internet Explorer 6 implementation of
@@ -59,7 +59,7 @@
      style.filter = 'alpha(opacity=0)';

      // Visibility of frame should match visiblity of popup element.
-    style.visibility = popup.style.visibility;
+    style.visibility = popup.currentStyle.visibility;

      // Issue 2443: remove styles that affect the size of the iframe
      style.border = 0;
@@ -71,14 +71,14 @@
      style.top = popup.offsetTop;
      style.width = popup.offsetWidth;
      style.height = popup.offsetHeight;
-    style.zIndex = popup.style.zIndex;
+    style.zIndex = popup.currentStyle.zIndex;

      // updates position and dimensions as popup is moved & resized
      style.setExpression('left', 'this.__popup.offsetLeft');
      style.setExpression('top', 'this.__popup.offsetTop');
      style.setExpression('width', 'this.__popup.offsetWidth');
      style.setExpression('height', 'this.__popup.offsetHeight');
-    style.setExpression('zIndex', 'this.__popup.style.zIndex');
+    style.setExpression('zIndex', 'this.__popup.currentStyle.zIndex');
      popup.parentElement.insertBefore(frame, popup);
    }-*/;

=======================================
---  
/trunk/user/src/com/google/gwt/user/client/ui/impl/PopupImplMozilla.java        
 
Wed Feb 25 09:37:22 2009
+++  
/trunk/user/src/com/google/gwt/user/client/ui/impl/PopupImplMozilla.java        
 
Tue Dec  1 16:25:52 2009
@@ -15,10 +15,12 @@
   */
  package com.google.gwt.user.client.ui.impl;

+import com.google.gwt.dom.client.Element;
+import com.google.gwt.dom.client.Style.Display;
+import com.google.gwt.dom.client.Style.Overflow;
  import com.google.gwt.user.client.Command;
  import com.google.gwt.user.client.DOM;
  import com.google.gwt.user.client.DeferredCommand;
-import com.google.gwt.user.client.Element;

  /**
   * Implementation class used by {...@link  
com.google.gwt.user.client.ui.PopupPanel}.
@@ -87,7 +89,7 @@
        // of underlying scrollbars. To get around this problem, we  
introduce an
        // inner div which acts as the new containing element for the  
PopupPanel,
        // and this element is the one to which all styling is applied to.
-      DOM.setInnerHTML(outerElem, "<div></div>");
+      outerElem.setInnerHTML("<div></div>");

        // Mozilla determines the default stacking order for heavyweight  
elements
        // by their order on the page. If the PopupPanel is declared before
@@ -99,7 +101,7 @@
        // the PopupPanel becomes the highest element in the stacking order.
        DeferredCommand.addCommand(new Command() {
          public void execute() {
-          DOM.setStyleAttribute(outerElem, "overflow", "auto");
+          outerElem.getStyle().setOverflow(Overflow.AUTO);
          }
        });
      }
@@ -109,7 +111,7 @@

    @Override
    public Element getContainerElement(Element outerElem) {
-    return isFF2Mac ? DOM.getFirstChild(outerElem) : outerElem;
+    return isFF2Mac ? outerElem.getFirstChildElement() : outerElem;
    }

    @Override
@@ -120,7 +122,7 @@
    @Override
    public void setClip(Element popup, String rect) {
      super.setClip(popup, rect);
-    DOM.setStyleAttribute(popup, "display", "none");
-    DOM.setStyleAttribute(popup, "display", "");
+    popup.getStyle().setDisplay(Display.NONE);
+    popup.getStyle().clearDisplay();
    }
  }
=======================================
---  
/trunk/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome.css   
 
Thu Nov  5 11:48:25 2009
+++  
/trunk/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome.css   
 
Tue Dec  1 16:25:52 2009
@@ -479,7 +479,7 @@
    overflow: hidden;
  }

-.gwt-PopupGlass {
+.gwt-PopupPanelGlass {
    background-color: #000;
    opacity: 0.3;
    filter: alpha(opacity=30);
=======================================
---  
/trunk/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome_rtl.css
        
Thu Nov  5 11:48:25 2009
+++  
/trunk/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome_rtl.css
        
Tue Dec  1 16:25:52 2009
@@ -479,7 +479,7 @@
    overflow: hidden;
  }

-.gwt-PopupGlass {
+.gwt-PopupPanelGlass {
    background-color: #000;
    opacity: 0.3;
    filter: alpha(opacity=30);
=======================================
--- /trunk/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark.css     
 
Thu Nov  5 11:48:25 2009
+++ /trunk/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark.css     
 
Tue Dec  1 16:25:52 2009
@@ -463,7 +463,7 @@
    overflow: hidden;
  }

-.gwt-PopupGlass {
+.gwt-PopupPanelGlass {
    background-color: #0cf;
    opacity: 0.3;
    filter: alpha(opacity=30);
=======================================
---  
/trunk/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark_rtl.css     
 
Thu Nov  5 11:48:25 2009
+++  
/trunk/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark_rtl.css     
 
Tue Dec  1 16:25:52 2009
@@ -463,7 +463,7 @@
    overflow: hidden;
  }

-.gwt-PopupGlass {
+.gwt-PopupPanelGlass {
    background-color: #0cf;
    opacity: 0.3;
    filter: alpha(opacity=30);
=======================================
---  
/trunk/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard.css
      
Thu Nov  5 11:48:25 2009
+++  
/trunk/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard.css
      
Tue Dec  1 16:25:52 2009
@@ -479,7 +479,7 @@
    overflow: hidden;
  }

-.gwt-PopupGlass {
+.gwt-PopupPanelGlass {
    background-color: #000;
    opacity: 0.3;
    filter: alpha(opacity=30);
=======================================
---  
/trunk/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard_rtl.css
  
Thu Nov  5 11:48:25 2009
+++  
/trunk/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard_rtl.css
  
Tue Dec  1 16:25:52 2009
@@ -479,7 +479,7 @@
    overflow: hidden;
  }

-.gwt-PopupGlass {
+.gwt-PopupPanelGlass {
    background-color: #000;
    opacity: 0.3;
    filter: alpha(opacity=30);

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to