Changeset 1460


Ignore:
Timestamp:
03/21/07 18:38:30 (6 years ago)
Author:
thomas
Message:
  • src/today-main.c: Add support for icon themes, and assign applications to

the remaining launchers

Location:
trunk/src/target/OM-2007/applications/openmoko-today
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/OM-2007/applications/openmoko-today/ChangeLog

    r1436 r1460  
     1Wed, 21 Mar 2007 17:34:34 +0000 Thomas Wood 
     2 
     3        * src/today-main.c: Add support for icon themes, and assign applications to 
     4        the remaining launchers 
     5 
    16Tue, 20 Mar 2007 11:01:20 +0000 Thomas Wood 
    27 
  • trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c

    r1436 r1460  
    144144/** 
    145145 * today_launcher_button_new: 
    146  * @icon: stock name to use as the icon in the button 
    147146 * @exec: command to execute when the button is clicked 
    148147 * 
     
    152151 */ 
    153152static GtkWidget * 
    154 today_launcher_button_new (gchar * icon, gchar * exec) 
     153today_launcher_button_new (gchar * exec) 
    155154{ 
    156155  GtkWidget *button = moko_pixmap_button_new (); 
    157   GdkPixbuf *pb = gtk_widget_render_icon (button, icon, GTK_ICON_SIZE_BUTTON, ""); 
     156  GdkPixbuf *pb; 
     157  GtkIconTheme *icon_theme = gtk_icon_theme_get_default (); 
    158158 
    159159  /* libmokoui api really needs fixing... */ 
     160 
     161  if (gtk_icon_theme_has_icon (icon_theme, exec)) 
     162  { 
     163    pb = gtk_icon_theme_load_icon (icon_theme, exec, 48, GTK_ICON_LOOKUP_NO_SVG, NULL); 
     164  } 
     165  else 
     166  { 
     167    pb = gtk_icon_theme_load_icon (icon_theme, GTK_STOCK_MISSING_IMAGE, 48, GTK_ICON_LOOKUP_NO_SVG, NULL); 
     168  } 
     169 
    160170  moko_pixmap_button_set_finger_toolbox_btn_center_image_pixbuf ( 
    161171      MOKO_PIXMAP_BUTTON (button), pb); 
     
    253263 
    254264  gtk_container_add (GTK_CONTAINER (button_box), 
    255                      today_launcher_button_new (GTK_STOCK_EXECUTE, "contacts")); 
    256   gtk_container_add (GTK_CONTAINER (button_box), 
    257                      today_launcher_button_new (GTK_STOCK_EXECUTE, "")); 
    258   gtk_container_add (GTK_CONTAINER (button_box), 
    259                      today_launcher_button_new (GTK_STOCK_EXECUTE, "")); 
    260   gtk_container_add (GTK_CONTAINER (button_box), 
    261                      today_launcher_button_new (GTK_STOCK_EXECUTE, "")); 
    262   gtk_container_add (GTK_CONTAINER (button_box), 
    263                      today_launcher_button_new (GTK_STOCK_EXECUTE, "")); 
     265                     today_launcher_button_new ("openmoko-dialer")); 
     266  gtk_container_add (GTK_CONTAINER (button_box), 
     267                     today_launcher_button_new ("contacts")); 
     268  gtk_container_add (GTK_CONTAINER (button_box), 
     269                     today_launcher_button_new ("openmoko-messages")); 
     270  gtk_container_add (GTK_CONTAINER (button_box), 
     271                     today_launcher_button_new ("openmoko-gps")); 
     272  gtk_container_add (GTK_CONTAINER (button_box), 
     273                     today_launcher_button_new ("dates")); 
    264274 
    265275  /* signals */ 
Note: See TracChangeset for help on using the changeset viewer.