You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2010/04/07 12:10:46 UTC

svn commit: r931487 - in /myfaces/tobago/trunk: core/src/main/java/org/apache/myfaces/tobago/context/ core/src/main/java/org/apache/myfaces/tobago/renderkit/css/ theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/stand...

Author: lofwyr
Date: Wed Apr  7 10:10:46 2010
New Revision: 931487

URL: http://svn.apache.org/viewvc?rev=931487&view=rev
Log:
TOBAGO-870: Weight of scrollbars should be computed in the browser

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Overflow.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Style.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/mozilla/property/tobago-theme-config.properties
    myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/msie/property/tobago-theme-config.properties
    myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
    myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/theme-config.js
    myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/theme-config.js
    myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
    myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java?rev=931487&r1=931486&r2=931487&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java Wed Apr  7 10:10:46 2010
@@ -21,6 +21,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.myfaces.tobago.config.TobagoConfig;
 import org.apache.myfaces.tobago.internal.context.ClientPropertiesKey;
+import org.apache.myfaces.tobago.layout.Measure;
 import org.apache.myfaces.tobago.util.VariableResolverUtils;
 
 import javax.faces.component.UIViewRoot;
@@ -59,6 +60,9 @@ public class ClientProperties implements
 
   private Locale locale;
 
+  private Measure verticalScrollbarWeight;
+  private Measure horizontalScrollbarWeight;
+
   /** 
    * managed bean constructor
    */
@@ -221,4 +225,20 @@ public class ClientProperties implements
       reset();
     }
   }
+
+  public Measure getVerticalScrollbarWeight() {
+    return verticalScrollbarWeight;
+  }
+
+  public void setVerticalScrollbarWeight(Measure verticalScrollbarWeight) {
+    this.verticalScrollbarWeight = verticalScrollbarWeight;
+  }
+
+  public Measure getHorizontalScrollbarWeight() {
+    return horizontalScrollbarWeight;
+  }
+
+  public void setHorizontalScrollbarWeight(Measure horizontalScrollbarWeight) {
+    this.horizontalScrollbarWeight = horizontalScrollbarWeight;
+  }
 }

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Overflow.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Overflow.java?rev=931487&r1=931486&r2=931487&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Overflow.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Overflow.java Wed Apr  7 10:10:46 2010
@@ -20,7 +20,8 @@ package org.apache.myfaces.tobago.render
 public enum Overflow {
 
   AUTO("auto"),
-  HIDDEN("hidden");
+  HIDDEN("hidden"),
+  SCROLL("scroll");
 
   private String value;
 

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Style.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Style.java?rev=931487&r1=931486&r2=931487&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Style.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Style.java Wed Apr  7 10:10:46 2010
@@ -38,8 +38,10 @@ public class Style implements Serializab
   private Position position;
   private Overflow overflow;
   private Measure marginTop;
+  private Measure margin;
   private Measure paddingTop;
   private Measure paddingBottom;
+  private Measure padding;
   private String backgroundImage;
   private Integer zIndex;
 
@@ -55,8 +57,10 @@ public class Style implements Serializab
     this.position = map.position;
     this.overflow = map.overflow;
     this.marginTop = map.marginTop;
+    this.margin = map.margin;
     this.paddingTop = map.paddingTop;
     this.paddingBottom = map.paddingBottom;
+    this.padding = map.padding;
     this.backgroundImage = map.backgroundImage;
     this.zIndex = map.zIndex;
   }
@@ -145,6 +149,11 @@ public class Style implements Serializab
       buf.append(marginTop);
       buf.append(';');
     }
+    if (margin != null) {
+      buf.append("margin:");
+      buf.append(margin);
+      buf.append(';');
+    }
     if (paddingTop != null) {
       buf.append("padding-top:");
       buf.append(paddingTop);
@@ -155,6 +164,11 @@ public class Style implements Serializab
       buf.append(paddingBottom);
       buf.append(';');
     }
+    if (padding != null) {
+      buf.append("padding:");
+      buf.append(padding);
+      buf.append(';');
+    }
     if (backgroundImage != null) {
       buf.append("background-image:");
       buf.append(backgroundImage);
@@ -233,6 +247,14 @@ public class Style implements Serializab
     this.marginTop = marginTop;
   }
 
+  public Measure getMargin() {
+    return margin;
+  }
+
+  public void setMargin(Measure margin) {
+    this.margin = margin;
+  }
+
   public Measure getPaddingTop() {
     return paddingTop;
   }
@@ -249,6 +271,14 @@ public class Style implements Serializab
     this.paddingBottom = paddingBottom;
   }
 
+  public Measure getPadding() {
+    return padding;
+  }
+
+  public void setPadding(Measure padding) {
+    this.padding = padding;
+  }
+
   public String getBackgroundImage() {
     return backgroundImage;
   }

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java?rev=931487&r1=931486&r2=931487&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java Wed Apr  7 10:10:46 2010
@@ -27,6 +27,7 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.component.UIPage;
 import org.apache.myfaces.tobago.component.UIPopup;
 import org.apache.myfaces.tobago.config.Configurable;
+import org.apache.myfaces.tobago.context.ClientProperties;
 import org.apache.myfaces.tobago.context.ResourceManagerUtil;
 import org.apache.myfaces.tobago.context.TobagoFacesContext;
 import org.apache.myfaces.tobago.internal.component.AbstractUIPage;
@@ -37,6 +38,7 @@ import org.apache.myfaces.tobago.interna
 import org.apache.myfaces.tobago.internal.util.ResponseUtils;
 import org.apache.myfaces.tobago.layout.Measure;
 import org.apache.myfaces.tobago.renderkit.PageRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Overflow;
 import org.apache.myfaces.tobago.renderkit.css.Style;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
@@ -63,6 +65,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.StringTokenizer;
 
 public class PageRenderer extends PageRendererBase {
 
@@ -76,16 +79,42 @@ public class PageRenderer extends PageRe
     super.decode(facesContext, component);
     String clientId = component.getClientId(facesContext);
     ExternalContext externalContext = facesContext.getExternalContext();
-    String severity = (String) 
+
+    // severity
+    String severity = (String)
         externalContext.getRequestParameterMap().get(clientId + ComponentUtils.SUB_SEPARATOR + "clientSeverity");
     if (severity != null) {
       externalContext.getRequestMap().put(CLIENT_DEBUG_SEVERITY, severity);
     }
+
+    // last focus
     String lastFocusId = (String) 
         externalContext.getRequestParameterMap().get(clientId + ComponentUtils.SUB_SEPARATOR + LAST_FOCUS_ID);
     if (lastFocusId != null) {
       component.getAttributes().put(LAST_FOCUS_ID, lastFocusId);
     }
+
+    // scrollbar weight
+    String name = clientId + ComponentUtils.SUB_SEPARATOR + "scrollbar-weight";
+    String value = null;
+    try {
+      value = (String) facesContext.getExternalContext().getRequestParameterMap().get(name);
+      if (value != null) {
+        StringTokenizer tokenizer = new StringTokenizer(value, ";");
+        Measure vertical = Measure.valueOf(tokenizer.nextToken());
+        Measure horizontal = Measure.valueOf(tokenizer.nextToken());
+        if (vertical.greaterThan(Measure.valueOf(30)) || vertical.lessThan(Measure.valueOf(3))
+           || horizontal.greaterThan(Measure.valueOf(30)) || horizontal.lessThan(Measure.valueOf(3))) {
+          LOG.error("Ignoring strange values: vertical=" + vertical + " horizontal=" + horizontal);
+        } else {
+          ClientProperties client = VariableResolverUtils.resolveClientProperties(facesContext);
+          client.setVerticalScrollbarWeight(vertical);
+          client.setHorizontalScrollbarWeight(horizontal);
+        }
+      }
+    } catch (Exception e) {
+      LOG.error("Error in decoding '" + name + "': value='" + value + "'", e);
+    }
   }
 
   @Override
@@ -134,11 +163,12 @@ public class PageRenderer extends PageRe
     String contentType = writer.getContentTypeWithCharSet();
     ResponseUtils.ensureContentTypeHeader(facesContext, contentType);
     HtmlRendererUtils.renderDojoDndSource(facesContext, component);
+    final ClientProperties client = VariableResolverUtils.resolveClientProperties(facesContext);
+    final boolean debugMode = client.isDebugMode();
 
     String title = (String) page.getAttributes().get(Attributes.LABEL);
 
     writer.startElement(HtmlConstants.HEAD, null);
-    final boolean debugMode = VariableResolverUtils.resolveClientProperties(facesContext).isDebugMode();
 
     if (debugMode) {
       writer.writeJavascript("var TbgHeadStart = new Date();");
@@ -270,7 +300,21 @@ public class PageRenderer extends PageRe
       }
     }
 
-     if (component.getFacets().containsKey(Facets.RESIZE_ACTION)) {
+    String clientId = page.getClientId(facesContext);
+
+    final boolean calculateScrollbarWeight
+        = client.getVerticalScrollbarWeight() == null || client.getVerticalScrollbarWeight() == null;
+    if (calculateScrollbarWeight) {
+      facesContext.getOnloadScripts().add(
+          "Tobago.calculateScrollbarWeights('" + clientId + ComponentUtils.SUB_SEPARATOR + "scrollbar-weight" + "');");
+    } else {
+      facesContext.getOnloadScripts().add(
+          "Tobago.Config.set('Tobago', 'verticalScrollbarWeight', '" + client.getVerticalScrollbarWeight() + "');");
+      facesContext.getOnloadScripts().add(
+          "Tobago.Config.set('Tobago', 'horizontalScrollbarWeight', '" + client.getHorizontalScrollbarWeight() + "');");
+    }
+
+    if (component.getFacets().containsKey(Facets.RESIZE_ACTION)) {
       UIComponent facet = component.getFacet(Facets.RESIZE_ACTION);
       UIComponent command = null;
       if (facet instanceof UICommand) {
@@ -306,8 +350,6 @@ public class PageRenderer extends PageRe
     }
     writer.endJavascript();
 
-    String clientId = page.getClientId(facesContext);
-
     String defaultActionId = page.getDefaultActionId() != null ? page.getDefaultActionId() : "";
     writer.endElement(HtmlConstants.HEAD);
     writer.startElement(HtmlConstants.BODY, page);
@@ -372,6 +414,32 @@ public class PageRenderer extends PageRe
     writer.writeIdAttribute(clientId + ComponentUtils.SUB_SEPARATOR + "action-position");
     writer.endElement(HtmlConstants.INPUT);
 
+    if (calculateScrollbarWeight) {
+      Style style = new Style();
+      style.setOverflow(Overflow.SCROLL);
+      style.setWidth(Measure.valueOf(100));
+      style.setHeight(Measure.valueOf(100));
+      style.setPadding(Measure.ZERO);
+      style.setMargin(Measure.ZERO);
+      style.setZIndex(-1);
+
+      writer.startElement(HtmlConstants.DIV, null);
+      writer.writeStyleAttribute(style);
+
+      writer.startElement(HtmlConstants.DIV, null);
+      style.setOverflow(null);
+      writer.writeStyleAttribute(style);
+      writer.endElement(HtmlConstants.DIV);
+
+      writer.endElement(HtmlConstants.DIV);
+
+      writer.startElement(HtmlConstants.INPUT, null);
+      writer.writeAttribute(HtmlAttributes.TYPE, "hidden", false);
+      writer.writeNameAttribute(clientId + ComponentUtils.SUB_SEPARATOR + "scrollbar-weight");
+      writer.writeIdAttribute(clientId + ComponentUtils.SUB_SEPARATOR + "scrollbar-weight");
+      writer.endElement(HtmlConstants.INPUT);
+    }
+
     if (debugMode) {
       writer.startElement(HtmlConstants.INPUT, null);
       writer.writeAttribute(HtmlAttributes.VALUE, clientLogSeverity);

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java?rev=931487&r1=931486&r2=931487&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java Wed Apr  7 10:10:46 2010
@@ -29,6 +29,7 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.component.UIMenuCommand;
 import org.apache.myfaces.tobago.component.UIReload;
 import org.apache.myfaces.tobago.component.UISheet;
+import org.apache.myfaces.tobago.context.ClientProperties;
 import org.apache.myfaces.tobago.context.ResourceManager;
 import org.apache.myfaces.tobago.context.ResourceManagerFactory;
 import org.apache.myfaces.tobago.context.ResourceManagerUtil;
@@ -53,6 +54,7 @@ import org.apache.myfaces.tobago.renderk
 import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
 import org.apache.myfaces.tobago.util.ComponentUtils;
 import org.apache.myfaces.tobago.util.LayoutInfo;
+import org.apache.myfaces.tobago.util.VariableResolverUtils;
 import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
 
 import javax.faces.application.Application;
@@ -251,7 +253,7 @@ public class SheetRenderer extends Layou
       Measure space = bodyStyle.getWidth();
       space.subtractNotNegative(getContentBorder(facesContext, sheet));
       if (needVerticalScrollbar(facesContext, sheet, style)) {
-        space.subtractNotNegative(getScrollbarWidth(facesContext, sheet));
+        space.subtractNotNegative(getVerticalScrollbarWeight(facesContext, sheet));
       }
       sheetBodyStyle.setWidth(space);
     }
@@ -624,8 +626,14 @@ public class SheetRenderer extends Layou
     return getResourceManager().getThemeMeasure(facesContext, data, "rowPadding");
   }
 
-  private Measure getScrollbarWidth(FacesContext facesContext, UISheet data) {
-    return getResourceManager().getThemeMeasure(facesContext, data, "scrollbarWidth");
+  private Measure getVerticalScrollbarWeight(FacesContext facesContext, UISheet data) {
+    final ClientProperties clientProperties = VariableResolverUtils.resolveClientProperties(facesContext);
+    final Measure weight = clientProperties.getVerticalScrollbarWeight();
+    if (weight != null) {
+      return weight;
+    } else { // default
+      return getResourceManager().getThemeMeasure(facesContext, data, "verticalScrollbarWeight");
+    }
   }
 
   private void storeFooterHeight(FacesContext facesContext, UISheet data) {
@@ -917,13 +925,11 @@ public class SheetRenderer extends Layou
     RenderUtil.encode(facesContext, menu);
   }
 
-  private UIMenuCommand createMenuItem(final Application application, String label,
-                                       String action) {
-    UIMenuCommand menuItem
-        = (UIMenuCommand) application.createComponent(UIMenuCommand.COMPONENT_TYPE);
+  private UIMenuCommand createMenuItem(final Application application, String label, String action) {
+    UIMenuCommand menuItem = (UIMenuCommand) application.createComponent(UIMenuCommand.COMPONENT_TYPE);
     menuItem.setRendererType(RendererTypes.MENU_COMMAND);
-    menuItem.getAttributes().put(Attributes.ONCLICK, action);
-    menuItem.getAttributes().put(Attributes.LABEL, label);
+    menuItem.setOnclick(action);
+    menuItem.setLabel(label);
     return menuItem;
   }
 
@@ -1129,8 +1135,10 @@ public class SheetRenderer extends Layou
       Measure space = data.getCurrentWidth();
       space = space.subtractNotNegative(getContentBorder(facesContext, data));
       if (needVerticalScrollbar(facesContext, data, style)) {
-        space = space.subtractNotNegative(getScrollbarWidth(facesContext, data));
+        space = space.subtractNotNegative(getVerticalScrollbarWeight(facesContext, data));
       }
+      // todo: not nice: 1 left + 1 right border
+      space = space.subtract(rendererdColumns.size() * 2);
       LayoutInfo layoutInfo =
           new LayoutInfo(newTokens.getSize(), space.getPixel(), newTokens, data.getClientId(facesContext), false);
       parseFixedWidth(facesContext, layoutInfo, rendererdColumns);

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/mozilla/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/mozilla/property/tobago-theme-config.properties?rev=931487&r1=931486&r2=931487&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/mozilla/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/mozilla/property/tobago-theme-config.properties Wed Apr  7 10:10:46 2010
@@ -15,9 +15,6 @@
 # limitations under the License.
 #
 
-# scrollbarWidth is 16 in Windows2000 on mozilla; 16 is the default
-#Tobago.scrollbarWidth=15
-
 Box.componentExtraWidth=24
 Box.paddingHeight=14
 Box.headerHeight=28

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/msie/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/msie/property/tobago-theme-config.properties?rev=931487&r1=931486&r2=931487&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/msie/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/msie/property/tobago-theme-config.properties Wed Apr  7 10:10:46 2010
@@ -18,16 +18,9 @@
 Box.paddingTopWhenToolbar=0
 Box.extraPaddingHeightWhenToolbar=23
 
+# IE can't have td with 0px height
+Messages.fixedHeight=1
 
 ToolBar.small_bottom_Height=56
 ToolBar.big_bottom_Height=73
 ToolBar.fixedHeight=31
-
-
-# IE can't have td with 0px height
-Messages.fixedHeight=1
-
-
-# scrollbarWidth is 16, but on some ie's need's to be 17 to prevent horizontal
-# scroolbar 
-Sheet.scrollbarWidth=17

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties?rev=931487&r1=931486&r2=931487&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties Wed Apr  7 10:10:46 2010
@@ -23,7 +23,6 @@ Tobago.componentExtraHeight=0
 Tobago.fixedWidth=250
 Tobago.fixedHeight=25
 Tobago.pickerSpace=5
-Tobago.scrollbarWidth=19
 Tobago.clientBorder=12
 Tobago.headerHeight=0
 Tobago.labelSpace=0
@@ -153,7 +152,8 @@ Sheet.leftOffset=0
 Sheet.topOffset=0
 Sheet.rightOffset=0
 Sheet.bottomOffset=0
-Sheet.scrollbarWidth=19
+Sheet.verticalScrollbarWeight=17
+Sheet.horizontalScrollbarWeight=17
 
 Tab.paddingWidth=0
 Tab.paddingHeight=0

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/theme-config.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/theme-config.js?rev=931487&r1=931486&r2=931487&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/theme-config.js (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/theme-config.js Wed Apr  7 10:10:46 2010
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 
-
 Tobago.Config.set("Tobago", "themeConfig", "scarborough/standard");
 
  /**
@@ -24,24 +23,16 @@ Tobago.Config.set("Tobago", "themeConfig
   */
 Tobago.Config.set("Popup", "borderWidth", 4);
 
-
 /**
  * Additional top offset for toolbar button dropdown menu
  */
 Tobago.Config.set("Menu", "toolbarTopOffset", -1);
 
 /**
-  * Width of sheets scrollbar
-  */
-Tobago.Config.set("Sheet", "scrollbarWidth",
-    (navigator.userAgent.indexOf("Gecko") != -1) ? 16 : 17);
-
-/**
   * Width of border from sheets content div := style width * 2
   */
 Tobago.Config.set("Sheet", "contentBorderWidth", 2);
 
-
 /**
  * Additional top offset for sheet selector dropdown menu
  */
@@ -50,4 +41,4 @@ Tobago.Config.set("Sheet", "contentBorde
 /**
  * Additional top offset for toolbar dropdown menu
  */
- Tobago.Config.set("Menu", "ToolBarButtonMenuTopOffset", -1);
\ No newline at end of file
+ Tobago.Config.set("Menu", "ToolBarButtonMenuTopOffset", -1);

Modified: myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/theme-config.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/theme-config.js?rev=931487&r1=931486&r2=931487&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/theme-config.js (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/theme-config.js Wed Apr  7 10:10:46 2010
@@ -54,11 +54,6 @@ Tobago.Config =  {
 Tobago.Config.set("Tobago", "themeConfig", "standard/standard");
 
  /**
-  * scrollbar width, may be browser specific
-  */
-Tobago.Config.set("Tobago", "scrollbarWidth", 15);
-
- /**
   * Additional left offset for toolbar button dropdown menu
   */
 Tobago.Config.set("Menu", "toolbarLeftOffset", 0);

Modified: myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js?rev=931487&r1=931486&r2=931487&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js Wed Apr  7 10:10:46 2010
@@ -716,7 +716,7 @@ Tobago.Sheet.prototype.adjustHeaderDiv =
     if (clientWidth == 0) {
       clientWidth = Math.min(contentWidth, boxSum);
     }
-    var minWidth = contentWidth - Tobago.Config.get("Sheet", "scrollbarWidth")
+    var minWidth = contentWidth - Tobago.Config.get("Tobago", "horizontalScrollbarWeight")
                    - Tobago.Config.get("Sheet", "contentBorderWidth");
     minWidth = Math.max(minWidth, 0); // not less than 0
     headerDiv.style.width = Math.max(clientWidth, minWidth);

Modified: myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=931487&r1=931486&r2=931487&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Wed Apr  7 10:10:46 2010
@@ -1089,7 +1089,15 @@ var Tobago = {
   escapeClientId : function(id) {
     return "#" + id.replace(/:/g,"\\:");
   },
-  
+
+  calculateScrollbarWeights : function(id) {
+    var hidden = jQuery(Tobago.escapeClientId(id));
+    var outer = hidden.prev();
+    hidden.val(""
+        + (100 - outer.attr("clientWidth")) + ";"
+        + (100 - outer.attr("clientHeight")));
+  },
+
   clickOnElement: function(id) {
     var element = this.element(id);
 //    LOG.debug("id = " + id + "  element = " + typeof element);