javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupListBox.cpp
branchRCL_3
changeset 77 7cee158cb8cd
parent 66 2455ef1f5bbc
child 83 26b2b12093af
--- a/javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupListBox.cpp	Tue Sep 14 21:06:50 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupListBox.cpp	Wed Sep 15 12:05:25 2010 +0300
@@ -20,6 +20,8 @@
 // API for iChoiceControl
 #include "CMIDChoiceGroupControl.h"
 #include "CMIDChoiceGroupModel.h"
+// API for control item
+#include "CMIDControlItem.h"
 
 #include <e32def.h>
 // using for CColumnListBoxData related to colors
@@ -100,6 +102,7 @@
 #endif //RD_JAVA_ADVANCED_TACTILE_FEEDBACK
 #endif //RD_TACTILE_FEEDBACK
 
+    SetTextColors();
 }
 
 // Overridden, because CEikListBox returns EKeyWasConsumed when
@@ -341,31 +344,47 @@
         MAknsSkinInstance* skin = AknsUtils::SkinInstance();
         TRgb color;
 
-        // icon color, checkbox, radio button
+        // Chose correct colors for elements
+        TInt logicalColor = KNonHighlightedItemTextColor; // non-highlighted
+
+#ifdef RD_JAVA_S60_RELEASE_9_2
+        if (iChoiceControl
+                && iChoiceControl->ChoiceType() != MMIDChoiceGroup::EPopup
+                && iChoiceControl->ControlItem()
+                && iChoiceControl->ControlItem()->IsHighlighted())
+        {
+            logicalColor = KHighlightedItemTextColor; // highlighted
+        }
+#endif // RD_JAVA_S60_RELEASE_9_2
+
         TInt error = AknsUtils::GetCachedColor(skin,
                                                color,
-                                               KAknsIIDQsnIconColors,
-                                               EAknsCIQsnIconColorsCG14);
-
+                                               KAknsIIDQsnTextColors,
+                                               logicalColor);
         if (!error)
         {
             colors.iText = color;
         }
 
-        // icon color, setting list highlight   checkbox, radio button
         error = AknsUtils::GetCachedColor(skin,
                                           color,
-                                          KAknsIIDQsnIconColors,
-                                          EAknsCIQsnIconColorsCG14);
-
+                                          KAknsIIDQsnTextColors,
+                                          logicalColor);
         if (!error)
         {
             colors.iHighlightedText = color;
         }
     }
 
-    View()->ItemDrawer()->SetTextColor(colors.iText);
-    View()->ItemDrawer()->SetHighlightedTextColor(colors.iHighlightedText);
+    if (View() && View()->ItemDrawer())
+    {
+#ifdef RD_JAVA_S60_RELEASE_9_2
+        View()->ItemDrawer()->SetFlags(
+            CListItemDrawer::EUseOverrideSkinTextColor);
+#endif // RD_JAVA_S60_RELEASE_9_2
+        View()->ItemDrawer()->SetTextColor(colors.iText);
+        View()->ItemDrawer()->SetHighlightedTextColor(colors.iHighlightedText);
+    }
 }
 
 
@@ -586,4 +605,9 @@
 {
     return iHighlight;
 }
+
+void CMIDChoiceGroupListBox::UpdateColors()
+{
+    SetTextColors();
+}
 #endif // RD_JAVA_S60_RELEASE_9_2