You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by gc...@apache.org on 2008/11/13 22:19:06 UTC

svn commit: r713827 - /myfaces/trinidad/branches/1.2.8.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/NavigationPaneRenderer.java

Author: gcrawford
Date: Thu Nov 13 13:19:06 2008
New Revision: 713827

URL: http://svn.apache.org/viewvc?rev=713827&view=rev
Log:
TRINIDAD-1264 In Mobile Devices - commandNavigationItem has alignment problems with its Text and icon

apply patch from Tadashi, thanks Tadashi!

Modified:
    myfaces/trinidad/branches/1.2.8.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/NavigationPaneRenderer.java

Modified: myfaces/trinidad/branches/1.2.8.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/NavigationPaneRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.8.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/NavigationPaneRenderer.java?rev=713827&r1=713826&r2=713827&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.8.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/NavigationPaneRenderer.java (original)
+++ myfaces/trinidad/branches/1.2.8.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/NavigationPaneRenderer.java Thu Nov 13 13:19:06 2008
@@ -545,12 +545,12 @@
   {
     if ( (iconUri != null) && !isRtl )
     {
-      _appendIcon(context, rw, iconUri, isRtl);
+      _appendIcon(context, rw, iconUri, isRtl, arc);
     }
     _writeItemLink(context, arc, rw, itemData, isDisabled);
     if ( (iconUri != null) && isRtl )
     {
-      _appendIcon(context, rw, iconUri, isRtl);
+      _appendIcon(context, rw, iconUri, isRtl, arc);
     }
   }
 
@@ -558,20 +558,38 @@
     FacesContext context,
     ResponseWriter rw,
     String iconUri,
-    boolean isRtl
+    boolean isRtl,
+    RenderingContext arc
     ) throws IOException
   {
+    String styleAppender = "";
     rw.startElement("img", null);
     rw.writeAttribute("border", "0", null);
     rw.writeAttribute("align", "absmiddle", null);
-    if (isRtl)
+
+    if (isPDA(arc))
     {
-      rw.writeAttribute("style", "padding-left: 5px; float: right;", null);
+      if (isRtl)
+      {
+        rw.writeAttribute("style", "padding-left: 5px;", null);
+      }
+      else
+      {
+        rw.writeAttribute("style", "padding-right: 5px;", null);
+      }
     }
     else
     {
-      rw.writeAttribute("style", "padding-right: 5px; float: left;", null);
+      if (isRtl)
+      {
+        rw.writeAttribute("style", "padding-left: 5px; float: right;", null);
+      }
+      else
+      {
+        rw.writeAttribute("style", "padding-right: 5px; float: left;", null);
+      }
     }
+
     Application application = context.getApplication();
     ViewHandler handler = application.getViewHandler();
     String resolvedIconUri = handler.getResourceURL(context, iconUri);