private void PaintCell(object item, int column_index, int row_index, Rectangle area, bool opaque, bool bold,
                               StateType state, bool dragging)
        {
            ColumnCell cell = column_cache[column_index].Column.GetCell(0);

            cell.BindListItem(item);
            ColumnCellDataProvider(cell, item);

            ITextCell text_cell = cell as ITextCell;

            if (text_cell != null)
            {
                text_cell.FontWeight = bold ? Pango.Weight.Bold : Pango.Weight.Normal;
            }

            if (dragging)
            {
                Cairo.Color fill_color = Theme.Colors.GetWidgetColor(GtkColorClass.Base, StateType.Normal);
                fill_color.A        = 0.5;
                cairo_context.Color = fill_color;
                cairo_context.Rectangle(area.X, area.Y, area.Width, area.Height);
                cairo_context.Fill();
            }

            cairo_context.Save();
            cairo_context.Translate(area.X, area.Y);
            cell_context.Area   = area;
            cell_context.Opaque = opaque;
            cell.Render(cell_context, dragging ? StateType.Normal : state, area.Width, area.Height);
            cairo_context.Restore();

            AccessibleCellRedrawn(column_index, row_index);
        }
示例#2
0
        private void PaintCell(Cairo.Context cr, object item, int column_index, int row_index, Rectangle area, bool opaque, bool bold,
                               StateFlags state, bool dragging)
        {
            ColumnCell cell = column_cache[column_index].Column.GetCell(0);

            cell.Bind(item);
            cell.Manager = manager;
            ColumnCellDataProvider(cell, item);

            ITextCell text_cell = cell as ITextCell;

            if (text_cell != null)
            {
                text_cell.FontWeight = bold ? Pango.Weight.Bold : Pango.Weight.Normal;
            }

            if (dragging)
            {
                StyleContext.Save();
                StyleContext.AddClass("entry");
                Cairo.Color fill_color = CairoExtensions.GdkRGBAToCairoColor(StyleContext.GetBackgroundColor(StateFlags.Normal));
                StyleContext.Restore();
                fill_color.A = 0.5;
                cr.Color     = fill_color;
                cr.Rectangle(area.X, area.Y, area.Width, area.Height);
                cr.Fill();
            }

            cr.Save();
            cr.Translate(area.X, area.Y);
            cell_context.Area   = area;
            cell_context.Opaque = opaque;
            cell_context.State  = dragging ? StateFlags.Normal : state;
            cell.Render(cell_context, area.Width, area.Height);
            cr.Restore();

            AccessibleCellRedrawn(column_index, row_index);
        }