pidgin/gtkcellview.c

branch
next.minor
changeset 25888
d0fdd378a635
parent 19859
71d37b57eff2
equal deleted inserted replaced
25887:6eac2f6c32e2 25888:d0fdd378a635
461 461
462 /* render cells */ 462 /* render cells */
463 area = widget->allocation; 463 area = widget->allocation;
464 464
465 /* we draw on our very own window, initialize x and y to zero */ 465 /* we draw on our very own window, initialize x and y to zero */
466 area.x = widget->allocation.x + (rtl ? widget->allocation.width : 0); 466 area.x = widget->allocation.x + (rtl ? widget->allocation.width : 0);
467 area.y = widget->allocation.y; 467 area.y = widget->allocation.y;
468 468
469 if (GTK_WIDGET_STATE (widget) == GTK_STATE_PRELIGHT) 469 if (GTK_WIDGET_STATE (widget) == GTK_STATE_PRELIGHT)
470 state = GTK_CELL_RENDERER_PRELIT; 470 state = GTK_CELL_RENDERER_PRELIT;
471 else 471 else
472 state = 0; 472 state = 0;
473 473
474 /* PACK_START */ 474 /* PACK_START */
475 for (i = cellview->priv->cell_list; i; i = i->next) 475 for (i = cellview->priv->cell_list; i; i = i->next)
476 { 476 {
477 GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)i->data; 477 GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)i->data;
478 478
481 481
482 if (!info->cell->visible) 482 if (!info->cell->visible)
483 continue; 483 continue;
484 484
485 area.width = info->real_width; 485 area.width = info->real_width;
486 if (rtl) 486 if (rtl)
487 area.x -= area.width; 487 area.x -= area.width;
488 488
489 gtk_cell_renderer_render (info->cell, 489 gtk_cell_renderer_render (info->cell,
490 event->window, 490 event->window,
491 widget, 491 widget,
492 /* FIXME! */ 492 /* FIXME! */
493 &area, &area, &event->area, state); 493 &area, &area, &event->area, state);
494 494
495 if (!rtl) 495 if (!rtl)
496 area.x += info->real_width; 496 area.x += info->real_width;
497 } 497 }
498 498
499 area.x = rtl ? widget->allocation.x : (widget->allocation.x + widget->allocation.width); 499 area.x = rtl ? widget->allocation.x : (widget->allocation.x + widget->allocation.width);
500 500
501 /* PACK_END */ 501 /* PACK_END */
502 for (i = cellview->priv->cell_list; i; i = i->next) 502 for (i = cellview->priv->cell_list; i; i = i->next)
503 { 503 {
504 GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)i->data; 504 GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)i->data;
509 if (!info->cell->visible) 509 if (!info->cell->visible)
510 continue; 510 continue;
511 511
512 area.width = info->real_width; 512 area.width = info->real_width;
513 if (!rtl) 513 if (!rtl)
514 area.x -= area.width; 514 area.x -= area.width;
515 515
516 gtk_cell_renderer_render (info->cell, 516 gtk_cell_renderer_render (info->cell,
517 widget->window, 517 widget->window,
518 widget, 518 widget,
519 /* FIXME ! */ 519 /* FIXME ! */
548 GList *i; 548 GList *i;
549 GtkTreeIter iter; 549 GtkTreeIter iter;
550 GtkTreePath *path; 550 GtkTreePath *path;
551 551
552 g_return_if_fail (cellview->priv->displayed_row != NULL); 552 g_return_if_fail (cellview->priv->displayed_row != NULL);
553 553
554 path = gtk_tree_row_reference_get_path (cellview->priv->displayed_row); 554 path = gtk_tree_row_reference_get_path (cellview->priv->displayed_row);
555 gtk_tree_model_get_iter (cellview->priv->model, &iter, path); 555 gtk_tree_model_get_iter (cellview->priv->model, &iter, path);
556 gtk_tree_path_free (path); 556 gtk_tree_path_free (path);
557 557
558 for (i = cellview->priv->cell_list; i; i = i->next) 558 for (i = cellview->priv->cell_list; i; i = i->next)
664 GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)cellview->priv->cell_list->data; 664 GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)cellview->priv->cell_list->data;
665 665
666 gtk_cell_view_cell_layout_clear_attributes (layout, info->cell); 666 gtk_cell_view_cell_layout_clear_attributes (layout, info->cell);
667 g_object_unref (G_OBJECT (info->cell)); 667 g_object_unref (G_OBJECT (info->cell));
668 g_free (info); 668 g_free (info);
669 cellview->priv->cell_list = g_list_delete_link (cellview->priv->cell_list, 669 cellview->priv->cell_list = g_list_delete_link (cellview->priv->cell_list,
670 cellview->priv->cell_list); 670 cellview->priv->cell_list);
671 } 671 }
672 } 672 }
673 673
674 static void 674 static void
717 while (list && list->next) 717 while (list && list->next)
718 { 718 {
719 g_free (list->data); 719 g_free (list->data);
720 list = list->next->next; 720 list = list->next->next;
721 } 721 }
722 722
723 g_slist_free (info->attributes); 723 g_slist_free (info->attributes);
724 info->attributes = NULL; 724 info->attributes = NULL;
725 } 725 }
726 } 726 }
727 727
903 903
904 /** 904 /**
905 * gtk_cell_view_set_displayed_row: 905 * gtk_cell_view_set_displayed_row:
906 * @cell_view: a #GtkCellView 906 * @cell_view: a #GtkCellView
907 * @path: a #GtkTreePath or %NULL to unset. 907 * @path: a #GtkTreePath or %NULL to unset.
908 * 908 *
909 * Sets the row of the model that is currently displayed 909 * Sets the row of the model that is currently displayed
910 * by the #GtkCellView. If the path is unset, then the 910 * by the #GtkCellView. If the path is unset, then the
911 * contents of the cellview "stick" at their last value; 911 * contents of the cellview "stick" at their last value;
912 * this is not normally a desired result, but may be 912 * this is not normally a desired result, but may be
913 * a needed intermediate state if say, the model for 913 * a needed intermediate state if say, the model for

mercurial