2006-09-22 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
authorMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Fri, 22 Sep 2006 14:08:45 +0000 (14:08 +0000)
committerMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Fri, 22 Sep 2006 14:08:45 +0000 (14:08 +0000)
* hildon-widgets-plugins/hildon-color-chooser-dialog-hsv.c:
* hildon-widgets-plugins/hildon-color-chooser-hsv.c: Changing the name
in witch the borders afre being draw around color selectors. Fixes
NB#40057.
Making the dimmed color bar/plane look a bit nicer.

* hildon-widgets/hildon-name-password-dialog.c: Changing the 'name'
property of the dialog to 'username'. Fixes #MB772.

ChangeLog
hildon-widgets-plugins/hildon-color-chooser-dialog-hsv.c
hildon-widgets-plugins/hildon-color-chooser-hsv.c
hildon-widgets/hildon-name-password-dialog.c

index 6940e14..a7d4c61 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-09-22  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
+
+       * hildon-widgets-plugins/hildon-color-chooser-dialog-hsv.c:
+       * hildon-widgets-plugins/hildon-color-chooser-hsv.c: Changing the name
+       in witch the borders afre being draw around color selectors. Fixes
+       NB#40057.
+       Making the dimmed color bar/plane look a bit nicer. 
+
+       * hildon-widgets/hildon-name-password-dialog.c: Changing the 'name'
+       property of the dialog to 'username'. Fixes #MB772. 
+
 2006-09-21  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
 
        * hildon-widgets/hildon-font-selection-dialog.c: Do not put the
index e72d44b..9cbda04 100644 (file)
@@ -831,12 +831,35 @@ static gboolean hildon_color_chooser_dialog_hsv_area_expose(GtkWidget *widget, G
     x = ((i % w) * (tot_w + spacing));
     y = ((i / w) * (tot_h + spacing));
 
-    if(brd) {
-      gtk_paint_box(gtk_widget_get_style(GTK_WIDGET(dialog)), widget->window, (i == num_selected) ? GTK_STATE_SELECTED : GTK_STATE_NORMAL,
-                    (i == num_selected) ? GTK_SHADOW_IN : GTK_SHADOW_OUT, &event->area, GTK_WIDGET(dialog), "color-radio", x, y, tot_w, tot_h);
-    }
-
-    gdk_draw_rectangle(widget->window, start_gc[i], TRUE, event->area.x, event->area.y, event->area.width, event->area.height);
+    gdk_draw_rectangle(widget->window,
+                       widget->style->black_gc,
+                       TRUE,
+                       (i == num_selected) ? x : x + 2,  
+                       (i == num_selected) ? y : y + 2,
+                       (i == num_selected) ? tot_w : tot_w - 4,
+                       (i == num_selected) ? tot_h : tot_h - 4);
+
+    gdk_draw_rectangle(widget->window,
+                       widget->style->white_gc,
+                       TRUE,
+                       x + 3,  
+                       y + 3,
+                       tot_w - 6,
+                       tot_h - 6);
+
+    gdk_draw_rectangle(widget->window,
+                       start_gc [i],
+                       TRUE,
+                       x + 3 + 1,  
+                       y + 3 + 1,
+                       tot_w - 6 - 2,
+                       tot_h - 6 - 2);
+
+//      gtk_paint_box(gtk_widget_get_style(GTK_WIDGET(dialog)), widget->window, (i == num_selected) ? GTK_STATE_SELECTED : GTK_STATE_NORMAL,
+//                    (i == num_selected) ? GTK_SHADOW_IN : GTK_SHADOW_OUT, &event->area, GTK_WIDGET(dialog), "color-radio", x, y, tot_w, tot_h);
+    //}
+
+    //gdk_draw_rectangle(widget->window, start_gc[i], TRUE, event->area.x, event->area.y, event->area.width, event->area.height);
   }
 
 
index 403b69d..9c62d72 100644 (file)
@@ -857,7 +857,6 @@ inline void inline_draw_hue_bar(GtkWidget *widget, int x, int y, int w, int h, i
     return;
   }
 
-
   buf = (unsigned char *)g_malloc(w*h*3);
 
   hvec = 65535/sh;
@@ -906,8 +905,7 @@ inline void inline_draw_hue_bar_dimmed(GtkWidget *widget, int x, int y, int w, i
     return;
   }
 
-
-  buf = (unsigned char *)g_malloc(w*h*3);
+  buf = (unsigned char *)g_malloc(w*h*4);
 
   hvec = 65535/sh;
   hcurr = hvec * (y - sy);
@@ -923,17 +921,17 @@ inline void inline_draw_hue_bar_dimmed(GtkWidget *widget, int x, int y, int w, i
       ptr[0] = avg;
       ptr[1] = avg;
       ptr[2] = avg;
-      ptr += 3;
+      ptr[3] = ((((i % 2) + j) % 2) == 0) ? 60 : 10;
+      ptr += 4;
     }
 
     hcurr += hvec;
   }
 
+  GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data (buf, GDK_COLORSPACE_RGB, TRUE, 8, w, h, w * 4, g_free, buf);
 
-  gdk_draw_rgb_image(widget->parent->window, widget->style->fg_gc[0], x, y, w, h, GDK_RGB_DITHER_NONE, buf, w*3);
-
-
-  g_free(buf);
+  gdk_draw_pixbuf (widget->parent->window, widget->style->fg_gc [0], pixbuf, 0, 0, x, y, w, h, GDK_RGB_DITHER_NONE, 0, 0);
+  g_object_unref (pixbuf);
 }
 
 
@@ -1048,7 +1046,7 @@ inline void inline_draw_sv_plane_dimmed(HildonColorChooserHSV *sel, int x, int y
   }
 
 
-  buf = (unsigned char *)g_malloc(w*h*3);
+  buf = (unsigned char *)g_malloc(w*h*4);
 
   ptr = buf;
 
@@ -1088,10 +1086,11 @@ inline void inline_draw_sv_plane_dimmed(HildonColorChooserHSV *sel, int x, int y
       ptr[0] = avg;
       ptr[1] = avg;
       ptr[2] = avg;
+      ptr[3] = ((((i % 2) + j) % 2) == 0) ? 60 : 10;
       rgbtmp[0] += rgbx[0];
       rgbtmp[1] += rgbx[1];
       rgbtmp[2] += rgbx[2];
-      ptr += 3;
+      ptr += 4;
     }
 
     rgbx[0] += rgby[0];
@@ -1099,11 +1098,10 @@ inline void inline_draw_sv_plane_dimmed(HildonColorChooserHSV *sel, int x, int y
     rgbx[2] += rgby[2];
   }
 
+  GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data (buf, GDK_COLORSPACE_RGB, TRUE, 8, w, h, w * 4, g_free, buf);
 
-  gdk_draw_rgb_image(widget->parent->window, widget->style->fg_gc[0], x, y, w, h, GDK_RGB_DITHER_NONE, buf, w*3);
-
-
-  g_free(buf);
+  gdk_draw_pixbuf (widget->parent->window, widget->style->fg_gc [0], pixbuf, 0, 0, x, y, w, h, GDK_RGB_DITHER_NONE, 0, 0);
+  g_object_unref (pixbuf);
 }
 
 
index 9464c88..1d3387f 100644 (file)
@@ -74,7 +74,7 @@ struct _HildonNamePasswordDialogPrivate {
 enum{
     PROP_NONE = 0,
     PROP_CONTENT,
-    PROP_NAME,
+    PROP_USERNAME,
     PROP_PASSWORD
 };
 
@@ -106,7 +106,7 @@ hildon_name_password_dialog_set_property(GObject * object,
       /* Set the password domain text */
       hildon_name_password_dialog_set_domain(dialog, g_value_get_string(value));
       break;
-    case PROP_NAME:
+    case PROP_USERNAME:
       /* Set the current username displayed in the dialog */
       gtk_entry_set_text(priv->nameEntry, g_value_get_string(value));
       break;
@@ -135,7 +135,7 @@ hildon_name_password_dialog_get_property(GObject * object,
     case PROP_CONTENT:
       g_value_set_string(value, gtk_label_get_text(priv->domainLabel));
       break;
-    case PROP_NAME:
+    case PROP_USERNAME:
       g_value_set_string(value, hildon_name_password_dialog_get_name(dialog));
       break;
     case PROP_PASSWORD:
@@ -168,9 +168,9 @@ hildon_name_password_dialog_class_init(HildonNamePasswordDialogClass *class)
                            G_PARAM_READWRITE));
 
     g_object_class_install_property(object_class,
-                    PROP_NAME, 
-                    g_param_spec_string ("name",
-                            "Name",
+                    PROP_USERNAME, 
+                    g_param_spec_string ("username",
+                            "Username",
                             "Set content for name entry.",
                             "DEFAULT",
                             G_PARAM_READWRITE));
@@ -299,7 +299,7 @@ GtkWidget *hildon_name_password_dialog_new(GtkWindow * parent)
 /**
  * hildon_name_password_dialog_new_with_default:
  * @parent: the parent window of the dialog
- * @name: default name, NULL if unset
+ * @name: default username, NULL if unset
  * @password: default password, NULL if unset
  * 
  * Same as #hildon_name_password_dialog_new, but with a 
@@ -314,7 +314,7 @@ GtkWidget *hildon_name_password_dialog_new_with_default(GtkWindow   *parent,
     GtkWidget *self = hildon_name_password_dialog_new(parent);
 
     if(name != NULL)
-      g_object_set(G_OBJECT(self), "name", name, NULL);
+      g_object_set(G_OBJECT(self), "username", name, NULL);
     if(password != NULL)
       g_object_set(G_OBJECT(self), "password", password, NULL);