r2914 - in trunk/src/target/OM-2007.2/applications/openmoko-today2: . libtaku

chris at sita.openmoko.org chris at sita.openmoko.org
Wed Sep 5 15:26:27 CEST 2007


Author: chris
Date: 2007-09-05 15:26:25 +0200 (Wed, 05 Sep 2007)
New Revision: 2914

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-today2/ChangeLog
   trunk/src/target/OM-2007.2/applications/openmoko-today2/libtaku/launcher-util.c
   trunk/src/target/OM-2007.2/applications/openmoko-today2/libtaku/taku-icon-tile.c
   trunk/src/target/OM-2007.2/applications/openmoko-today2/libtaku/taku-table.c
Log:
Synchronise with upstream matchbox-desktop-2


Modified: trunk/src/target/OM-2007.2/applications/openmoko-today2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-today2/ChangeLog	2007-09-05 11:43:46 UTC (rev 2913)
+++ trunk/src/target/OM-2007.2/applications/openmoko-today2/ChangeLog	2007-09-05 13:26:25 UTC (rev 2914)
@@ -1,10 +1,21 @@
+2007-09-05  Chris Lord,,,  <chris at openedhand.com>
+
+	* libtaku/launcher-util.c: (launcher_start):
+	* libtaku/taku-icon-tile.c: (make_bold), (taku_icon_tile_init),
+	(taku_icon_tile_set_icon_name), (taku_icon_tile_set_primary):
+	* libtaku/taku-table.c: (calculate_columns),
+	(taku_table_class_init):
+	Synchronise with upstream matchbox-desktop-2
+
 2007-09-05  Thomas Wood  <thomas at openedhand.com>
 
-	* libtaku/taku-launcher-tile.c: (taku_launcher_tile_class_init): Update with
-	changes in r1644 of upstream (matchbox-desktop-2: Rename TakuIcon icon size to
-	taku-icon, to match GTK+.)
-	* src/today-launcher.c: (today_launcher_page_create): Update for above changes
+	* libtaku/taku-launcher-tile.c: (taku_launcher_tile_class_init):
+	Update with changes in r1644 of upstream (matchbox-desktop-2:
+	Rename TakuIcon icon size to taku-icon, to match GTK+.)
 
+	* src/today-launcher.c: (today_launcher_page_create):
+	Update for above changes
+
 2007-09-02	Michael Lauer <mickey at openmoko.org>
 
 	* src/today-pim-summary.c: (today_pim_summary_update_date):

Modified: trunk/src/target/OM-2007.2/applications/openmoko-today2/libtaku/launcher-util.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-today2/libtaku/launcher-util.c	2007-09-05 11:43:46 UTC (rev 2913)
+++ trunk/src/target/OM-2007.2/applications/openmoko-today2/libtaku/launcher-util.c	2007-09-05 13:26:25 UTC (rev 2914)
@@ -289,7 +289,7 @@
 
 /* TODO: optionally link to GtkUnique and directly handle that? */
 void
-launcher_start (GtkWidget *widget, const LauncherData *data)
+launcher_start (GtkWidget *widget, LauncherData *data)
 {
   GError *error = NULL;
 #ifdef USE_LIBSN
@@ -344,17 +344,20 @@
   if (!g_spawn_async (
 #endif
                             NULL, data->argv, NULL,
-                            G_SPAWN_SEARCH_PATH, child_setup,
+                            G_SPAWN_SEARCH_PATH,
+                            child_setup,
 #ifdef USE_LIBSN
-                            data->use_sn ? context : NULL, 
+                            data->use_sn ? context : NULL,
 #else
                             NULL,
 #endif
-                            NULL, &error)) {
+                            NULL,
+                            &error)) {
     g_warning ("Cannot launch %s: %s", data->argv[0], error->message);
     g_error_free (error);
 #ifdef USE_LIBSN
-    sn_launcher_context_complete (context);
+    if (context)
+      sn_launcher_context_complete (context);
 #endif
   }
   

Modified: trunk/src/target/OM-2007.2/applications/openmoko-today2/libtaku/taku-icon-tile.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-today2/libtaku/taku-icon-tile.c	2007-09-05 11:43:46 UTC (rev 2913)
+++ trunk/src/target/OM-2007.2/applications/openmoko-today2/libtaku/taku-icon-tile.c	2007-09-05 13:26:25 UTC (rev 2914)
@@ -90,12 +90,33 @@
 }
 
 static void
-taku_icon_tile_init (TakuIconTile *self)
+make_bold (GtkLabel *label)
 {
-  GtkWidget *vbox, *hbox;
   PangoAttribute *attr;
   PangoAttrList *list;
 
+  list = pango_attr_list_new ();
+
+  attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
+  attr->start_index = 0;
+  attr->end_index = G_MAXUINT;
+  pango_attr_list_insert (list, attr);
+
+  attr = pango_attr_scale_new (1.2);
+  attr->start_index = 0;
+  attr->end_index = G_MAXUINT;
+  pango_attr_list_insert (list, attr);
+
+  gtk_label_set_attributes (label, list);
+  
+  pango_attr_list_unref (list);
+}
+
+static void
+taku_icon_tile_init (TakuIconTile *self)
+{
+  GtkWidget *vbox, *hbox;
+
   self->priv = GET_PRIVATE (self);
 
   hbox = gtk_hbox_new (FALSE, 6);
@@ -110,22 +131,11 @@
 
   self->priv->primary = gtk_label_new (NULL);
   gtk_label_set_ellipsize (GTK_LABEL (self->priv->primary), PANGO_ELLIPSIZE_END);
+  make_bold (GTK_LABEL (self->priv->primary));
   gtk_widget_show (self->priv->primary);
   gtk_misc_set_alignment (GTK_MISC (self->priv->primary), 0.0, 0.5);
   gtk_box_pack_start (GTK_BOX (vbox), self->priv->primary, TRUE, TRUE, 0);
-  
-  list = pango_attr_list_new ();
-  attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
-  attr->start_index = 0;
-  attr->end_index = G_MAXUINT;
-  pango_attr_list_insert (list, attr);
-  attr = pango_attr_scale_new (1.2);
-  attr->start_index = 0;
-  attr->end_index = G_MAXUINT;
-  pango_attr_list_insert (list, attr);
-  gtk_label_set_attributes (GTK_LABEL (self->priv->primary), list);
-  pango_attr_list_unref (list);
-  
+
   self->priv->secondary = gtk_label_new (NULL);
   gtk_label_set_ellipsize (GTK_LABEL (self->priv->secondary), PANGO_ELLIPSIZE_END);
   gtk_widget_show (self->priv->secondary);
@@ -157,7 +167,7 @@
   g_return_if_fail (TAKU_IS_ICON_TILE (tile));
 
   gtk_image_set_from_icon_name (GTK_IMAGE (tile->priv->icon),
-                                name, gtk_icon_size_from_name ("TakuIcon"));
+                                name, gtk_icon_size_from_name ("taku-icon"));
 }
 
 void
@@ -166,6 +176,8 @@
   g_return_if_fail (TAKU_IS_ICON_TILE (tile));
 
   gtk_label_set_text (GTK_LABEL (tile->priv->primary), text);
+
+  atk_object_set_name (gtk_widget_get_accessible (GTK_WIDGET (tile)), text);
 }
 
 const char *

Modified: trunk/src/target/OM-2007.2/applications/openmoko-today2/libtaku/taku-table.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-today2/libtaku/taku-table.c	2007-09-05 11:43:46 UTC (rev 2913)
+++ trunk/src/target/OM-2007.2/applications/openmoko-today2/libtaku/taku-table.c	2007-09-05 13:26:25 UTC (rev 2914)
@@ -16,6 +16,7 @@
  * Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+#include <config.h>
 #include <gtk/gtk.h>
 #include <string.h>
 #include "eggsequence.h"
@@ -26,6 +27,8 @@
 #define GET_PRIVATE(o) \
   (G_TYPE_INSTANCE_GET_PRIVATE ((o), TAKU_TYPE_TABLE, TakuTablePrivate))
 
+#define DEFAULT_WIDTH 30
+
 struct _TakuTablePrivate
 {
   int columns;
@@ -311,6 +314,7 @@
   PangoContext *context;
   PangoFontMetrics *metrics;
   int width, new_cols;
+  guint cell_text_width = DEFAULT_WIDTH;
 
   /* If we are currently reflowing the tiles, or the final allocation hasn't
      been decided yet, return */
@@ -321,8 +325,10 @@
   context = gtk_widget_get_pango_context (widget);
   metrics = pango_context_get_metrics (context, widget->style->font_desc, NULL);
 
+  gtk_widget_style_get (widget, "cell-text-width", &cell_text_width, NULL);
+
   width = PANGO_PIXELS
-          (30 * pango_font_metrics_get_approximate_char_width (metrics));
+          (cell_text_width * pango_font_metrics_get_approximate_char_width (metrics));
   new_cols = MAX (1, widget->allocation.width / width);
 
   if (table->priv->columns != new_cols) {
@@ -495,6 +501,13 @@
   
   container_class->add    = container_add;
   container_class->remove = container_remove;
+
+  gtk_widget_class_install_style_property (widget_class, g_param_spec_uint
+                                           ("cell-text-width", "cell text width",
+                                            "Width of the tiles in characters",
+                                            0, G_MAXUINT, DEFAULT_WIDTH,
+                                            G_PARAM_READABLE));
+
 }
 
 static void





More information about the commitlog mailing list