protected override bool OnExposeEvent(Gdk.EventExpose ev)
{
base.OnExposeEvent (ev);
using (Context g = Gdk.CairoHelper.Create (GdkWindow)) {
g.FillRectangle (secondary_rect, PintaCore.Palette.SecondaryColor);
g.DrawRectangle (new Rectangle (secondary_rect.X + 1, secondary_rect.Y + 1, secondary_rect.Width - 2, secondary_rect.Height - 2), new Color (1, 1, 1), 1);
g.DrawRectangle (secondary_rect, new Color (0, 0, 0), 1);
g.FillRectangle (primary_rect, PintaCore.Palette.PrimaryColor);
g.DrawRectangle (new Rectangle (primary_rect.X + 1, primary_rect.Y + 1, primary_rect.Width - 2, primary_rect.Height - 2), new Color (1, 1, 1), 1);
g.DrawRectangle (primary_rect, new Color (0, 0, 0), 1);
g.DrawPixbuf (swap_icon, swap_rect.Location ());
// Draw swatches
int x = 7;
for (int i = 0; i < 48; i++) {
if (i == 16 || i == 32)
x += 15;
g.FillRectangle (new Rectangle (x, 60 + ((i % 16) * 15), 15, 15), palette[i]);
}
}
return true;
}