You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2008/11/11 09:08:46 UTC

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

Author: matzew
Date: Tue Nov 11 00:08:45 2008
New Revision: 712981

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

Thx to Mamallan Uthaman for the patch

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

Modified: myfaces/trinidad/branches/1.2.9.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.9.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/NavigationPaneRenderer.java?rev=712981&r1=712980&r2=712981&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.9.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/NavigationPaneRenderer.java (original)
+++ myfaces/trinidad/branches/1.2.9.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/NavigationPaneRenderer.java Tue Nov 11 00:08:45 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);