protected override bool OnExposeEvent(EventExpose evnt) { Gdk.Rectangle rectangle = new Gdk.Rectangle(this.alignment.Allocation.X, this.box.Allocation.Y, this.alignment.Allocation.Width, this.box.Allocation.Height); if (this.hasFrame && (!this.roundedShape || this.roundedShape && !this.customRoundedShapeDrawing)) { Gtk.Style.PaintShadow(this.entry.Style, (Drawable)this.GdkWindow, StateType.Normal, ShadowType.In, evnt.Area, (Widget)this.entry, "entry", rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height); } else if (!this.roundedShape) { using (Cairo.Context cr = Gdk.CairoHelper.Create((Drawable)this.GdkWindow)) { cr.RoundedRectangle((double)rectangle.X + 0.5, (double)rectangle.Y + 0.5, (double)(rectangle.Width - 1), (double)(rectangle.Height - 1), 4.0); HelperMethods.SetSourceColor(cr, this.entry.Style.Base(StateType.Normal).ToCairoColor()); cr.Fill(); } } else { using (Cairo.Context context = Gdk.CairoHelper.Create((Drawable)this.GdkWindow)) { SearchEntry.RoundBorder(context, (double)rectangle.X + 0.5, (double)rectangle.Y + 0.5, (double)(rectangle.Width - 1), (double)(rectangle.Height - 1)); HelperMethods.SetSourceColor(context, this.entry.Style.Base(StateType.Normal).ToCairoColor()); context.Fill(); } } this.PropagateExpose(this.Child, evnt); if (this.hasFrame && this.roundedShape && this.customRoundedShapeDrawing) { using (Cairo.Context context = Gdk.CairoHelper.Create((Drawable)this.GdkWindow)) { SearchEntry.RoundBorder(context, (double)rectangle.X + 0.5, (double)rectangle.Y + 0.5, (double)(rectangle.Width - 1), (double)(rectangle.Height - 1)); HelperMethods.SetSourceColor(context, Styles.WidgetBorderColor); context.LineWidth = 1.0; context.Stroke(); } } return(true); }