Index: apps/gui/color_picker.c
===================================================================
RCS file: /cvsroot/rockbox/apps/gui/color_picker.c,v
retrieving revision 1.6
diff -u -r1.6 color_picker.c
--- apps/gui/color_picker.c	21 Mar 2006 02:02:04 -0000	1.6
+++ apps/gui/color_picker.c	19 Jul 2006 14:06:19 -0000
@@ -16,6 +16,7 @@
  * KIND, either express or implied.
  *
  ****************************************************************************/
+#include "config.h"
 #include "stdarg.h"
 #include "string.h"
 #include "stdio.h"
@@ -75,7 +76,7 @@
 #endif
 
 static const int max_val[3] = {LCD_MAX_RED,LCD_MAX_GREEN,LCD_MAX_BLUE};
-
+    
 static void draw_screen(struct screen *display, char *title,
                         int *rgb_val, int color, int row)
 {
@@ -87,6 +88,7 @@
     int slider_width = (display->width-SLIDER_START-(display->char_width*5));
     int background_color = global_settings.bg_color;
     int text_color = global_settings.fg_color;
+    bool display_three_rows = (display->height/6) > display->char_height;
 
     display->clear_display();
 
@@ -97,21 +99,23 @@
     i = display->getstringsize(title,0,0);
     display->putsxy((display->width-i)/2,6,title );
 
-    for (i=0;i<3;i++)
+    text_top = display->char_height*2;
+    for (i=0; i<3 ;i++)
     {
-        text_top =display->char_height*((i*2)+2);
+        if (!display_three_rows)
+            i = row;        
 
-        if (i==row)
+        if ((i==row))
         {
-            if (global_settings.invert_cursor)
+            if ((global_settings.invert_cursor) && (display->depth >2))
             {
                 display->fillrect(0,text_top-1,display->width,display->char_height+2);
                 bg_col = text_color;
             }
-            else
+            else if (display_three_rows)
             {
                 display->putsxy(0,text_top,">");
-                display->putsxy(display->width-TEXT_MARGIN,text_top,"<");
+                display->putsxy(display->width-display->char_width-2,text_top,"<");
                 bg_col = background_color;
             }
             if (display->depth > 1)
@@ -145,6 +149,9 @@
         gui_scrollbar_draw(display,SLIDER_START,text_top,slider_width,
                            display->char_height/2,
                            max_val[i],0,rgb_val[i],HORIZONTAL);
+        if (!display_three_rows)
+           break;
+        text_top += display->char_height;
     }
 
     if (display->depth > 1) {
@@ -152,7 +159,7 @@
         display->set_foreground(text_color);
     }
 
-    if (text_top + (display->char_height*2) < (LCD_HEIGHT-40-display->char_height))
+    if (text_top + (display->char_height*2) < (display->height-40-display->char_height))
         text_top += (display->char_height*2);
     else text_top += (display->char_height);
 
@@ -162,7 +169,7 @@
                                  RGB_UNPACK_GREEN(color),
                                  RGB_UNPACK_BLUE(color));
 
-    display->putsxy((LCD_WIDTH-(display->char_width*21))/2,text_top,buf);
+    display->putsxy((display->width-(display->char_width*11))/2,text_top,buf);
 
     if (display->depth > 1) {
         display->set_foreground(color);
@@ -183,11 +190,10 @@
  ***********/
 bool set_color(struct screen *display,char *title, int* color, int banned_color)
 {
-    int exit = 0, button, slider=0;
+    int exit = 0, button, slider=0,i;
     int rgb_val[3]; /* native depth r,g,b*/;
     int fgcolor = display->get_foreground();
     int newcolor = *color;
-    int i;
 
 #if LCD_PIXELFORMAT == RGB565
     rgb_val[0] = ((*color)&0xf800) >> 11;
@@ -213,20 +219,22 @@
         newcolor = swap16((rgb_val[0] << 11) | (rgb_val[1] << 5) | (rgb_val[2]));
 #endif
         FOR_NB_SCREENS(i)
+        {
             draw_screen(&screens[i], title, rgb_val, newcolor, slider);
-
+        }
+        
         button = button_get(true);
         switch (button)
         {
             case SLIDER_UP:
-#ifdef HAVE_LCD_REMOTE
+#ifdef SLIDER_RC_UP
             case SLIDER_RC_UP:
 #endif
                 slider = (slider+2)%3;
                 break;
 
             case SLIDER_DOWN:
-#ifdef HAVE_LCD_REMOTE
+#ifdef SLIDER_RC_DOWN
             case SLIDER_RC_DOWN:
 #endif
                 slider = (slider+1)%3;
@@ -234,7 +242,7 @@
 
             case SLIDER_RIGHT:
             case SLIDER_RIGHT|BUTTON_REPEAT:
-#ifdef HAVE_LCD_REMOTE
+#ifdef SLIDER_RC_RIGHT
             case SLIDER_RC_RIGHT:
             case SLIDER_RC_RIGHT|BUTTON_REPEAT:
 #endif
@@ -244,7 +252,7 @@
 
             case SLIDER_LEFT:
             case SLIDER_LEFT|BUTTON_REPEAT:
-#ifdef HAVE_LCD_REMOTE
+#ifdef SLIDER_RC_LEFT
             case SLIDER_RC_LEFT:
             case SLIDER_RC_LEFT|BUTTON_REPEAT:
 #endif
@@ -253,7 +261,7 @@
                 break;
 
             case SLIDER_OK:
-#ifdef HAVE_LCD_REMOTE
+#ifdef HAVE_REMOTE_LCD
             case SLIDER_RC_OK:
 #endif
 #ifdef SLIDER_OK2
@@ -269,7 +277,7 @@
                 break;
 
             case SLIDER_CANCEL:
-#ifdef HAVE_LCD_REMOTE
+#ifdef HAVE_REMOTE_LCD
             case SLIDER_RC_CANCEL:
 #endif
                 exit = 1;
