コード例 #1
0
        private void HeaderExpose(object ob, Gtk.ExposeEventArgs a)
        {
            Gdk.Rectangle rect = new Gdk.Rectangle(0, 0, header.Allocation.Width - 1, header.Allocation.Height);
            HslColor      gcol = frame.Style.Background(Gtk.StateType.Normal);

            if (pointerHover)
            {
                gcol.L *= 1.05;
            }
            gcol.L = Math.Min(1, gcol.L);

            using (Cairo.Context cr = Gdk.CairoHelper.Create(a.Event.Window)) {
                cr.NewPath();
                cr.MoveTo(0, 0);
                cr.RelLineTo(rect.Width, 0);
                cr.RelLineTo(0, rect.Height);
                cr.RelLineTo(-rect.Width, 0);
                cr.RelLineTo(0, -rect.Height);
                cr.ClosePath();
                Cairo.SolidPattern solidPattern = new Cairo.SolidPattern(gcol);
                cr.Pattern = solidPattern;
                cr.FillPreserve();
                solidPattern.Destroy();
            }

            header.GdkWindow.DrawRectangle(frame.Style.DarkGC(Gtk.StateType.Normal), false, rect);

            foreach (Widget child in header.Children)
            {
                header.PropagateExpose(child, a.Event);
            }
        }
コード例 #2
0
 protected virtual void ShapeSurface(Cairo.Context cr, Cairo.Color color)
 {
     cr.Operator = Cairo.Operator.Source;
     Cairo.Pattern pattern = new Cairo.SolidPattern(color, false);
     cr.Source = pattern;
     pattern.Destroy();
     cr.Paint();
 }
コード例 #3
0
		private void HeaderExpose (object ob, Gtk.ExposeEventArgs a)
		{
			Gdk.Rectangle rect = new Gdk.Rectangle (0, 0, header.Allocation.Width - 1, header.Allocation.Height);
			HslColor gcol = frame.Style.Background (Gtk.StateType.Normal);
			
			if (pointerHover)
				gcol.L *= 1.05;
			gcol.L = Math.Min (1, gcol.L);
				
			using (Cairo.Context cr = Gdk.CairoHelper.Create (a.Event.Window)) {
				cr.NewPath ();
				cr.MoveTo (0, 0);
				cr.RelLineTo (rect.Width, 0);
				cr.RelLineTo (0, rect.Height);
				cr.RelLineTo (-rect.Width, 0);
				cr.RelLineTo (0, -rect.Height);
				cr.ClosePath ();
				Cairo.SolidPattern solidPattern = new Cairo.SolidPattern (gcol);
				cr.Pattern = solidPattern;
				cr.FillPreserve ();
				solidPattern.Destroy ();
			}
			
			header.GdkWindow.DrawRectangle (frame.Style.DarkGC (Gtk.StateType.Normal), false, rect);
			
			foreach (Widget child in header.Children)
				header.PropagateExpose (child, a.Event);
		}
コード例 #4
0
 protected virtual void ShapeSurface (Cairo.Context cr, Cairo.Color color)
 {
     cr.Operator = Cairo.Operator.Source;
     Cairo.Pattern pattern = new Cairo.SolidPattern (color, false);
     cr.Source = pattern;
     pattern.Destroy ();
     cr.Paint ();
 }