src/gtkstatusbox.c

changeset 11753
4a35462e61c7
parent 11739
cc15987b3937
child 11755
3b1b0ff3c22e
equal deleted inserted replaced
11752:8319fac0c0e5 11753:4a35462e61c7
351 } 351 }
352 } 352 }
353 353
354 } 354 }
355 355
356 #if GTK_CHECK_VERSION(2,6,0)
356 static gboolean 357 static gboolean
357 dropdown_store_row_separator_func(GtkTreeModel *model, 358 dropdown_store_row_separator_func(GtkTreeModel *model,
358 GtkTreeIter *iter, gpointer data) 359 GtkTreeIter *iter, gpointer data)
359 { 360 {
360 GtkGaimStatusBoxItemType type; 361 GtkGaimStatusBoxItemType type;
372 if (type == GTK_GAIM_STATUS_BOX_TYPE_SEPARATOR) 373 if (type == GTK_GAIM_STATUS_BOX_TYPE_SEPARATOR)
373 return TRUE; 374 return TRUE;
374 375
375 return FALSE; 376 return FALSE;
376 } 377 }
378 #endif
377 379
378 static void 380 static void
379 gtk_gaim_status_box_init (GtkGaimStatusBox *status_box) 381 gtk_gaim_status_box_init (GtkGaimStatusBox *status_box)
380 { 382 {
381 GtkCellRenderer *text_rend; 383 GtkCellRenderer *text_rend;
417 status_box->cell_view = gtk_cell_view_new(); 419 status_box->cell_view = gtk_cell_view_new();
418 gtk_widget_show (status_box->cell_view); 420 gtk_widget_show (status_box->cell_view);
419 421
420 status_box->store = gtk_list_store_new(NUM_COLUMNS, G_TYPE_INT, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); 422 status_box->store = gtk_list_store_new(NUM_COLUMNS, G_TYPE_INT, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
421 status_box->dropdown_store = gtk_list_store_new(NUM_COLUMNS, G_TYPE_INT, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); 423 status_box->dropdown_store = gtk_list_store_new(NUM_COLUMNS, G_TYPE_INT, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
424 #if GTK_CHECK_VERSION(2,6,0)
422 gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(status_box), dropdown_store_row_separator_func, NULL, NULL); 425 gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(status_box), dropdown_store_row_separator_func, NULL, NULL);
426 #endif
423 gtk_combo_box_set_model(GTK_COMBO_BOX(status_box), GTK_TREE_MODEL(status_box->dropdown_store)); 427 gtk_combo_box_set_model(GTK_COMBO_BOX(status_box), GTK_TREE_MODEL(status_box->dropdown_store));
424 gtk_cell_view_set_model(GTK_CELL_VIEW(status_box->cell_view), GTK_TREE_MODEL(status_box->store)); 428 gtk_cell_view_set_model(GTK_CELL_VIEW(status_box->cell_view), GTK_TREE_MODEL(status_box->store));
425 gtk_combo_box_set_wrap_width(GTK_COMBO_BOX(status_box), 0); 429 gtk_combo_box_set_wrap_width(GTK_COMBO_BOX(status_box), 0);
426 gtk_list_store_append(status_box->store, &(status_box->iter)); 430 gtk_list_store_append(status_box->store, &(status_box->iter));
427 gtk_gaim_status_box_refresh(status_box); 431 gtk_gaim_status_box_refresh(status_box);

mercurial