r1460 - in trunk/src/target/OM-2007/applications/openmoko-today: . src
thomas at sita.openmoko.org
thomas at sita.openmoko.org
Wed Mar 21 18:38:31 CET 2007
Author: thomas
Date: 2007-03-21 18:38:30 +0100 (Wed, 21 Mar 2007)
New Revision: 1460
Modified:
trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog
trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c
Log:
* src/today-main.c: Add support for icon themes, and assign applications to
the remaining launchers
Modified: trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog 2007-03-21 14:28:29 UTC (rev 1459)
+++ trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog 2007-03-21 17:38:30 UTC (rev 1460)
@@ -1,3 +1,8 @@
+Wed, 21 Mar 2007 17:34:34 +0000 Thomas Wood
+
+ * src/today-main.c: Add support for icon themes, and assign applications to
+ the remaining launchers
+
Tue, 20 Mar 2007 11:01:20 +0000 Thomas Wood
* src/today-events-area.c: (render_event):
Modified: trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c 2007-03-21 14:28:29 UTC (rev 1459)
+++ trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c 2007-03-21 17:38:30 UTC (rev 1460)
@@ -143,7 +143,6 @@
/**
* today_launcher_button_new:
- * @icon: stock name to use as the icon in the button
* @exec: command to execute when the button is clicked
*
* Utility function to create new launcher buttons
@@ -151,12 +150,23 @@
* Return value: The parent widget of the new widgets
*/
static GtkWidget *
-today_launcher_button_new (gchar * icon, gchar * exec)
+today_launcher_button_new (gchar * exec)
{
GtkWidget *button = moko_pixmap_button_new ();
- GdkPixbuf *pb = gtk_widget_render_icon (button, icon, GTK_ICON_SIZE_BUTTON, "");
+ GdkPixbuf *pb;
+ GtkIconTheme *icon_theme = gtk_icon_theme_get_default ();
/* libmokoui api really needs fixing... */
+
+ if (gtk_icon_theme_has_icon (icon_theme, exec))
+ {
+ pb = gtk_icon_theme_load_icon (icon_theme, exec, 48, GTK_ICON_LOOKUP_NO_SVG, NULL);
+ }
+ else
+ {
+ pb = gtk_icon_theme_load_icon (icon_theme, GTK_STOCK_MISSING_IMAGE, 48, GTK_ICON_LOOKUP_NO_SVG, NULL);
+ }
+
moko_pixmap_button_set_finger_toolbox_btn_center_image_pixbuf (
MOKO_PIXMAP_BUTTON (button), pb);
g_object_unref (pb);
@@ -252,15 +262,15 @@
gtk_box_pack_start (GTK_BOX (vbox), button_box, FALSE, FALSE, 0);
gtk_container_add (GTK_CONTAINER (button_box),
- today_launcher_button_new (GTK_STOCK_EXECUTE, "contacts"));
+ today_launcher_button_new ("openmoko-dialer"));
gtk_container_add (GTK_CONTAINER (button_box),
- today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
+ today_launcher_button_new ("contacts"));
gtk_container_add (GTK_CONTAINER (button_box),
- today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
+ today_launcher_button_new ("openmoko-messages"));
gtk_container_add (GTK_CONTAINER (button_box),
- today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
+ today_launcher_button_new ("openmoko-gps"));
gtk_container_add (GTK_CONTAINER (button_box),
- today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
+ today_launcher_button_new ("dates"));
/* signals */
g_signal_connect (G_OBJECT (window), "delete-event",
More information about the commitlog
mailing list