Send commitlog mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:

   1. r3020 - in trunk/src/target/OM-2007.2/libraries/libmokoui2: .
      libmokoui ([EMAIL PROTECTED])
   2. r3021 - in
      trunk/src/target/OM-2007.2/libraries/moko-gtk-engine: .   data src
      ([EMAIL PROTECTED])
   3. r3022 - in
      trunk/src/target/OM-2007.2/libraries/moko-gtk-engine: .   data
      ([EMAIL PROTECTED])
   4. r3023 - in trunk/src/target/OM-2007.2/libraries/libmokoui2: .
      libmokoui ([EMAIL PROTECTED])
--- Begin Message ---
Author: thomas
Date: 2007-09-20 16:00:55 +0200 (Thu, 20 Sep 2007)
New Revision: 3020

Modified:
   trunk/src/target/OM-2007.2/libraries/libmokoui2/ChangeLog
   trunk/src/target/OM-2007.2/libraries/libmokoui2/libmokoui/moko-search-bar.c
Log:
* libmokoui/moko-search-bar.c: (moko_search_bar_init),
(moko_search_bar_new), (moko_search_bar_new_with_combo),
(moko_search_bar_get_combo_box), (moko_search_bar_get_entry),
(moko_search_bar_search_visible):

Add documentation for MokoSearchBar


Modified: trunk/src/target/OM-2007.2/libraries/libmokoui2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/libraries/libmokoui2/ChangeLog   2007-09-20 
13:33:19 UTC (rev 3019)
+++ trunk/src/target/OM-2007.2/libraries/libmokoui2/ChangeLog   2007-09-20 
14:00:55 UTC (rev 3020)
@@ -1,5 +1,14 @@
 2007-09-20  Thomas Wood  <[EMAIL PROTECTED]>
 
+       * libmokoui/moko-search-bar.c: (moko_search_bar_init),
+       (moko_search_bar_new), (moko_search_bar_new_with_combo),
+       (moko_search_bar_get_combo_box), (moko_search_bar_get_entry),
+       (moko_search_bar_search_visible):
+
+       Add documentation for MokoSearchBar
+
+2007-09-20  Thomas Wood  <[EMAIL PROTECTED]>
+
        * doc/reference/libmokoui2-docs.sgml: Add title and section name
 
 2007-09-19  Thomas Wood  <[EMAIL PROTECTED]>

Modified: 
trunk/src/target/OM-2007.2/libraries/libmokoui2/libmokoui/moko-search-bar.c
===================================================================
--- trunk/src/target/OM-2007.2/libraries/libmokoui2/libmokoui/moko-search-bar.c 
2007-09-20 13:33:19 UTC (rev 3019)
+++ trunk/src/target/OM-2007.2/libraries/libmokoui2/libmokoui/moko-search-bar.c 
2007-09-20 14:00:55 UTC (rev 3020)
@@ -217,6 +217,14 @@
                G_CALLBACK (entry_changed_cb), self);
 }
 
+/**
+ * moko_search_bar_new:
+ *
+ * Create a new MokoSearBar widget
+ *
+ * returns: The newly created MokoSearchBar
+ */
+
 GtkWidget *
 moko_search_bar_new (void)
 {
@@ -224,6 +232,15 @@
                "combo", gtk_combo_box_new (), NULL));
 }
 
+/**
+ * moko_search_bar_new_with_combo:
+ * @comno: a GtkComboBox to use as the combobox
+ *
+ * Creates a MokoSearchBar with the specified combo box
+ *
+ * returns: the newly created MokoSearchBar
+ */
+
 GtkWidget *
 moko_search_bar_new_with_combo (GtkComboBox *combo)
 {
@@ -231,6 +248,14 @@
                "combo", combo, NULL));
 }
 
+/**
+ * moko_search_bar_get_combo_box:
+ * @self: a MokoSearchBar
+ *
+ * Get a pointer to the GtkComboBox being used in the MokoSearchBar
+ *
+ * returns: the GtkComboBox
+ */
 GtkComboBox *
 moko_search_bar_get_combo_box (MokoSearchBar *self)
 {
@@ -239,6 +264,15 @@
        return combo;
 }
 
+
+/**
+ * moko_search_bar_get_entry:
+ * @self: a MokoSearchBar
+ *
+ * Retrieve the GtkEntry widget being used in the MokoSearchBar
+ *
+ * returns: the GtkEntry
+ */
 GtkEntry *
 moko_search_bar_get_entry (MokoSearchBar *self)
 {
@@ -247,6 +281,14 @@
        return entry;
 }
 
+/**
+ * moko_search_bar_search_visible:
+ * @self: a MokoSaerchBar
+ *
+ * Determine the visibility of the search entry.
+ *
+ * returns: TRUE if the search entry is visible
+ */
 gboolean
 moko_search_bar_search_visible (MokoSearchBar *self)
 {
@@ -255,6 +297,14 @@
        return GTK_WIDGET_VISIBLE (priv->entry);
 }
 
+
+/**
+ * moko_search_bar_toggle:
+ * @self: a MokoSearchBar
+ *
+ * Toggle the search button on the MokoSearchBar.
+ * This toggles the visibility of the combo box and entry widgets.
+ */
 void
 moko_search_bar_toggle (MokoSearchBar *self)
 {




--- End Message ---
--- Begin Message ---
Author: thomas
Date: 2007-09-20 19:09:14 +0200 (Thu, 20 Sep 2007)
New Revision: 3021

Modified:
   trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/ChangeLog
   trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/data/gtkrc
   trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-draw.c
   trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-style.c
   trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-style.h
Log:
* data/gtkrc:
* src/moko-draw.c: (moko_gradient), (moko_draw_box):
* src/moko-style.c: (moko_style_class_init):
* src/moko-style.h:

Add initial support for "border" and "gradient" boolean engine options


Modified: trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/ChangeLog      
2007-09-20 14:00:55 UTC (rev 3020)
+++ trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/ChangeLog      
2007-09-20 17:09:14 UTC (rev 3021)
@@ -1,3 +1,38 @@
+2007-09-20  Thomas Wood  <[EMAIL PROTECTED]>
+
+       * data/gtkrc:
+       * src/moko-draw.c: (moko_gradient), (moko_draw_box):
+       * src/moko-style.c: (moko_style_class_init):
+       * src/moko-style.h:
+
+       Add initial support for "border" and "gradient" boolean engine options
+
+2007-09-20  Thomas Wood  <[EMAIL PROTECTED]>
+
+       * moko-gtk-engine/src/moko-draw.c:
+
+         - Adjust gradient stops to give glossed appearance.
+         - Add gradient to "inactive" tabs
+
+       * moko-gtk-engine/src/moko-utils.h: rename from sato-utils.h
+
+       * moko-gtk-engine/data/openmoko-contacts
+       * moko-gtk-engine/data/openmoko-panel-plugins
+       * moko-gtk-engine/data/matchboxpanel
+       * moko-gtk-engine/data/openmoko-dialer
+       * moko-gtk-engine/data/gtkrc
+       * moko-gtk-engine/data/openmoko-calculator
+       * moko-gtk-engine/Makefile.am
+
+         - Add application specific rc files
+         - Tweak colours
+
+
+2007-09-18  Thomas Wood  <[EMAIL PROTECTED]>
+
+       * Rename Sato to Moko
+       * Adjust gradients and remove rounded corners
+
 2007-07-30  Thomas Wood  <[EMAIL PROTECTED]>
 
        * COPYING: Added LGPL version

Modified: trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/data/gtkrc
===================================================================
--- trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/data/gtkrc     
2007-09-20 14:00:55 UTC (rev 3020)
+++ trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/data/gtkrc     
2007-09-20 17:09:14 UTC (rev 3021)
@@ -84,11 +84,20 @@
 
 class "GtkWidget" style "default"
 
+style "button"
+{
+  engine "moko-engine" {
+    border = TRUE
+  }
+}
+class "GtkButton" style "button"
+
 style "combo-fix" {
+  bg[NORMAL] = "#ff7d00"
   text[NORMAL] = "white"
   text[PRELIGHT] = "white"
 }
-class "GtkComboBox" style "combo-fix"
+class "*Combo*" style "combo-fix"
 
 style "toolbar"
 {

Modified: trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-draw.c
===================================================================
--- trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-draw.c        
2007-09-20 14:00:55 UTC (rev 3020)
+++ trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-draw.c        
2007-09-20 17:09:14 UTC (rev 3021)
@@ -58,9 +58,9 @@
   gc = gdk_gc_new (window);
 
   /* get the start and end colours */
-  moko_shade_colour (&style->bg[state_type], &c1, 1.6);
+  moko_shade_colour (&style->bg[state_type], &c1, 1.8);
   moko_shade_colour (&style->bg[state_type], &c2, 1.4);
-  moko_shade_colour (&style->bg[state_type], &c3, 1.2);
+  moko_shade_colour (&style->bg[state_type], &c3, 1.3);
   moko_shade_colour (&style->bg[state_type], &c4, 1.0);
 
   /* set line for 1px */
@@ -158,14 +158,6 @@
    moko_gradient (style, window, state_type, x+1, y+1, width-2, height-2);
 
 
-
-   /*** treeview headers ***/
-  if (widget && GTK_IS_TREE_VIEW (widget->parent))
-  {
-    goto exit;
-  }
-
-
   if (DETAIL ("trough"))
   {
     if (widget && GTK_IS_HSCALE (widget))
@@ -184,7 +176,7 @@
   }
 
   /*** draw the border ***/
-  if (!DETAIL ("bar"))
+  if (MOKO_RC_STYLE (style->rc_style)->has_border)
   {
     gdk_draw_rectangle (window, gc, FALSE, x + 1, y + 1, width - 2, height - 
2);
   }

Modified: trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-style.c
===================================================================
--- trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-style.c       
2007-09-20 14:00:55 UTC (rev 3020)
+++ trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-style.c       
2007-09-20 17:09:14 UTC (rev 3021)
@@ -60,6 +60,7 @@
 moko_style_class_init (MokoStyleClass *klass)
 {
   GtkStyleClass *style_class = GTK_STYLE_CLASS (klass);
+
   moko_draw_style_class_init (style_class);
 }
 
@@ -67,17 +68,148 @@
 
 /*** Gtk Style RC Class 
*******************************************************/
 
+static struct
+{
+  gchar *name;
+  guint token;
+}
+moko_rc_symbols[] = 
+{
+  { "border", TOKEN_HAS_BORDER },
+  { "gradient", TOKEN_HAS_GRADIENT },
+
+  { "TRUE", TOKEN_TRUE },
+  { "FALSE", TOKEN_FALSE }
+};
+
 GType moko_type_rc_style = 0;
+static GtkRcStyleClass *moko_parent_rc_style_class;
 
 static GtkStyle *moko_rc_style_create_style (GtkRcStyle *rc_style);
+static void moko_rc_style_merge (GtkRcStyle *dest, GtkRcStyle *src);
+static guint moko_rc_style_parse (GtkRcStyle *rc_style, GtkSettings *settings, 
GScanner *scanner);
 
 static void
 moko_rc_style_class_init (MokoRcStyleClass *klass)
 {
        GtkRcStyleClass *rc_style_class = GTK_RC_STYLE_CLASS (klass);
+
+  moko_parent_rc_style_class = g_type_class_peek_parent (klass);
+
        rc_style_class->create_style = moko_rc_style_create_style;
+  rc_style_class->parse = moko_rc_style_parse;
+  rc_style_class->merge = moko_rc_style_merge;
 }
 
+
+static void
+moko_rc_style_merge (GtkRcStyle *dest, GtkRcStyle *src)
+{
+  if (MOKO_IS_RC_STYLE (src))
+  {
+    MokoRcStyle *src_data = MOKO_RC_STYLE (src);
+    MokoRcStyle *dest_data = MOKO_RC_STYLE (dest);
+
+    dest_data->has_border = src_data->has_border;
+    dest_data->has_gradient = src_data->has_gradient;
+  }
+
+  moko_parent_rc_style_class->merge (dest, src);
+}
+
+static guint
+moko_rc_parse_boolean(GScanner *scanner, GTokenType wanted_token, guint 
*retval)
+{
+  guint token;
+  
+  token = g_scanner_get_next_token(scanner);
+  if (token != wanted_token)
+    return wanted_token;
+  
+  token = g_scanner_get_next_token(scanner);
+  if (token != G_TOKEN_EQUAL_SIGN)
+    return G_TOKEN_EQUAL_SIGN;
+  
+  token = g_scanner_get_next_token(scanner);
+  if (token == TOKEN_TRUE)
+    *retval = TRUE;
+  else if (token == TOKEN_FALSE)
+    *retval = FALSE;
+  else
+    return TOKEN_TRUE;
+
+  return G_TOKEN_NONE;
+}
+
+static guint 
+moko_rc_style_parse (GtkRcStyle *rc_style, GtkSettings *settings, GScanner 
*scanner)
+{
+  static GQuark scope_id = 0;
+  MokoRcStyle *theme_data = MOKO_RC_STYLE (rc_style);
+  guint old_scope;
+  guint token;
+
+  /* Set up a our own scope for this scanner */
+
+  if (!scope_id)
+    scope_id = g_quark_from_string ("moko_gtk_engine");
+
+  old_scope = g_scanner_set_scope (scanner, scope_id);
+
+  /* check we haven't already added the moko symbols to this scanner */
+
+  if (!g_scanner_lookup_symbol (scanner, moko_rc_symbols[0].name))
+  {
+    gint i;
+    for (i = 0; i < G_N_ELEMENTS (moko_rc_symbols); i++)
+    {
+      g_scanner_scope_add_symbol (scanner, scope_id, moko_rc_symbols[i].name,
+          GINT_TO_POINTER (moko_rc_symbols[i].token));
+    }
+  }
+
+
+  token = g_scanner_peek_next_token (scanner);
+
+  while (token != G_TOKEN_RIGHT_CURLY)
+  {
+    guint i;
+
+    switch (token)
+    {
+      case TOKEN_HAS_BORDER:
+        token = moko_rc_parse_boolean (scanner, TOKEN_HAS_BORDER, &i);
+        if (token != G_TOKEN_NONE)
+          break;
+        theme_data->has_border = i;
+        break;
+      case TOKEN_HAS_GRADIENT:
+        token = moko_rc_parse_boolean (scanner, TOKEN_HAS_GRADIENT, &i);
+        if (token != G_TOKEN_NONE)
+          break;
+        theme_data->has_gradient = i;
+        break;
+
+      default:
+        g_scanner_get_next_token (scanner);
+        token = G_TOKEN_RIGHT_CURLY;
+        break;
+
+    }
+
+    if (token != G_TOKEN_NONE)
+    {
+      return token;
+    }
+    token = g_scanner_peek_next_token (scanner);
+  }
+
+  g_scanner_get_next_token (scanner);
+  g_scanner_set_scope (scanner, old_scope);
+
+  return G_TOKEN_NONE;
+}
+
 void
 moko_rc_style_register_type (GTypeModule *module)
 {

Modified: trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-style.h
===================================================================
--- trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-style.h       
2007-09-20 14:00:55 UTC (rev 3020)
+++ trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-style.h       
2007-09-20 17:09:14 UTC (rev 3021)
@@ -38,11 +38,11 @@
 extern GType moko_type_style;
 
 #define MOKO_TYPE_STYLE              moko_type_style
-#define MOKO_STYLE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), 
POKY_TYPE_STYLE, MokoStyle))
-#define MOKO_STYLE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), 
POKY_TYPE_STYLE, MokoStyleClass))
-#define MOKO_IS_STYLE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), 
POKY_TYPE_STYLE))
-#define MOKO_IS_STYLE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), 
POKY_TYPE_STYLE))
-#define MOKO_STYLE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), 
POKY_TYPE_STYLE, MokoStyleClass))
+#define MOKO_STYLE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), 
MOKO_TYPE_STYLE, MokoStyle))
+#define MOKO_STYLE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), 
MOKO_TYPE_STYLE, MokoStyleClass))
+#define MOKO_IS_STYLE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), 
MOKO_TYPE_STYLE))
+#define MOKO_IS_STYLE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), 
MOKO_TYPE_STYLE))
+#define MOKO_STYLE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), 
MOKO_TYPE_STYLE, MokoStyleClass))
 
 typedef struct _MokoStyle MokoStyle;
 typedef struct _MokoStyleClass MokoStyleClass;
@@ -66,11 +66,11 @@
 extern GType moko_type_rc_style;
 
 #define MOKO_TYPE_RC_STYLE              moko_type_rc_style
-#define MOKO_RC_STYLE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), 
POKY_TYPE_RC_STYLE, MokoRcStyle))
-#define MOKO_RC_STYLE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), 
POKY_TYPE_RC_STYLE, MokoRcStyleClass))
-#define MOKO_IS_RC_STYLE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), 
POKY_TYPE_RC_STYLE))
-#define MOKO_IS_RC_STYLE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), 
POKY_TYPE_RC_STYLE))
-#define MOKO_RC_STYLE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), 
POKY_TYPE_RC_STYLE, MokoRcStyleClass))
+#define MOKO_RC_STYLE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), 
MOKO_TYPE_RC_STYLE, MokoRcStyle))
+#define MOKO_RC_STYLE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), 
MOKO_TYPE_RC_STYLE, MokoRcStyleClass))
+#define MOKO_IS_RC_STYLE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), 
MOKO_TYPE_RC_STYLE))
+#define MOKO_IS_RC_STYLE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), 
MOKO_TYPE_RC_STYLE))
+#define MOKO_RC_STYLE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), 
MOKO_TYPE_RC_STYLE, MokoRcStyleClass))
 
 typedef struct _MokoRcStyle MokoRcStyle;
 typedef struct _MokoRcStyleClass MokoRcStyleClass;
@@ -78,15 +78,28 @@
 struct _MokoRcStyle
 {
   GtkRcStyle parent_instance;
+
+  gboolean has_border;
+  gboolean has_gradient;
 };
 
 struct _MokoRcStyleClass
 {
   GtkRcStyleClass parent_class;
+
 };
 
 void moko_rc_style_register_type (GTypeModule *engine);
 
+enum
+{
+  TOKEN_HAS_BORDER = G_TOKEN_LAST + 1,
+  TOKEN_HAS_GRADIENT,
+
+  TOKEN_TRUE,
+  TOKEN_FALSE
+};
+
 
/******************************************************************************/
 
 G_END_DECLS




--- End Message ---
--- Begin Message ---
Author: thomas
Date: 2007-09-21 10:00:03 +0200 (Fri, 21 Sep 2007)
New Revision: 3022

Modified:
   trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/ChangeLog
   trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/data/gtkrc
Log:
* data/gtkrc: Define some standard icon sizes


Modified: trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/ChangeLog      
2007-09-20 17:09:14 UTC (rev 3021)
+++ trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/ChangeLog      
2007-09-21 08:00:03 UTC (rev 3022)
@@ -1,3 +1,7 @@
+2007-09-21  Thomas Wood  <[EMAIL PROTECTED]>
+
+       * data/gtkrc: Define some standard icon sizes
+
 2007-09-20  Thomas Wood  <[EMAIL PROTECTED]>
 
        * data/gtkrc:

Modified: trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/data/gtkrc
===================================================================
--- trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/data/gtkrc     
2007-09-20 17:09:14 UTC (rev 3021)
+++ trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/data/gtkrc     
2007-09-21 08:00:03 UTC (rev 3022)
@@ -7,8 +7,9 @@
 # black: #333333
 # orange: #ff7d00
 
-gtk_button_images = 0
-gtk_menu_images = 0
+gtk-button-images = 0
+gtk-menu-images = 0
+gtk-icon-sizes = 
"gtk-button=32,32:gtk-small-toolbar=48,48:gtk-large-toolbar=48,48"
 
 style "default"
 {




--- End Message ---
--- Begin Message ---
Author: thomas
Date: 2007-09-21 11:34:30 +0200 (Fri, 21 Sep 2007)
New Revision: 3023

Modified:
   trunk/src/target/OM-2007.2/libraries/libmokoui2/ChangeLog
   trunk/src/target/OM-2007.2/libraries/libmokoui2/libmokoui/moko-stock.c
Log:
* libmokoui/moko-stock.c: (_moko_stock_add_icon):
Correctly load all the available sizes for additional stock icons


Modified: trunk/src/target/OM-2007.2/libraries/libmokoui2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/libraries/libmokoui2/ChangeLog   2007-09-21 
08:00:03 UTC (rev 3022)
+++ trunk/src/target/OM-2007.2/libraries/libmokoui2/ChangeLog   2007-09-21 
09:34:30 UTC (rev 3023)
@@ -1,3 +1,8 @@
+2007-09-21  Thomas Wood  <[EMAIL PROTECTED]>
+
+       * libmokoui/moko-stock.c: (_moko_stock_add_icon):
+       Correctly load all the available sizes for additional stock icons
+
 2007-09-20  Thomas Wood  <[EMAIL PROTECTED]>
 
        * libmokoui/moko-search-bar.c: (moko_search_bar_init),

Modified: trunk/src/target/OM-2007.2/libraries/libmokoui2/libmokoui/moko-stock.c
===================================================================
--- trunk/src/target/OM-2007.2/libraries/libmokoui2/libmokoui/moko-stock.c      
2007-09-21 08:00:03 UTC (rev 3022)
+++ trunk/src/target/OM-2007.2/libraries/libmokoui2/libmokoui/moko-stock.c      
2007-09-21 09:34:30 UTC (rev 3023)
@@ -77,24 +77,15 @@
   if (theme == NULL)
     theme = gtk_icon_theme_get_default ();
 
-  pixbuf = gtk_icon_theme_load_icon (theme, item->stock_id,
-                                     32, 0, NULL);
-
-  if (pixbuf == NULL)
-  {
-    g_print ("Cannot load stock icon from theme : %s\n", item->stock_id);
-    return;
-  }
-
   set = gtk_icon_set_new ();
 
-  /*
-   * This is temporary hack to make sure we have all the sizes available.
-   * Ideally we should try loading the pixbuf at the correct size from the 
theme
-   * for each possible size in GtkIconSize, rather than re-using the same 
pixbuf
-   */
   for (i = GTK_ICON_SIZE_MENU; i <= GTK_ICON_SIZE_DIALOG; i++)
   {
+    gint width, height;
+
+    gtk_icon_size_lookup (i, &width, &height);
+    pixbuf = gtk_icon_theme_load_icon (theme, item->stock_id, width, 0, NULL);
+
     source = gtk_icon_source_new ();
     gtk_icon_source_set_size (source, i);
     gtk_icon_source_set_size_wildcarded (source, FALSE);




--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to