private void RenderSelection (Gdk.Drawable drawable, Gdk.Rectangle background_area,
bool selected, StateType state)
{
if (view == null) {
return;
}
if (selected && view.Cr != null) {
Gdk.Rectangle rect = background_area;
rect.X -= 2;
rect.Width += 4;
// clear the standard GTK selection and focus
drawable.DrawRectangle (view.Style.BaseGC (StateType.Normal), true, rect);
// draw the hot cairo selection
if (!view.EditingRow) {
view.Theme.DrawRowSelection (view.Cr, background_area.X + 1, background_area.Y + 1,
background_area.Width - 2, background_area.Height - 2);
}
} else if (!TreeIter.Zero.Equals (iter) && iter.Equals (view.HighlightedIter) && view.Cr != null) {
view.Theme.DrawRowSelection (view.Cr, background_area.X + 1, background_area.Y + 1,
background_area.Width - 2, background_area.Height - 2, false);
} else if (view.NotifyStage.ActorCount > 0 && view.Cr != null) {
if (!TreeIter.Zero.Equals (iter) && view.NotifyStage.Contains (iter)) {
Actor<TreeIter> actor = view.NotifyStage[iter];
Cairo.Color color = view.Theme.Colors.GetWidgetColor (GtkColorClass.Background, StateType.Active);
color.A = Math.Sin (actor.Percent * Math.PI);
view.Theme.DrawRowSelection (view.Cr, background_area.X + 1, background_area.Y + 1,
background_area.Width - 2, background_area.Height - 2, true, true, color);
}
}
}