aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/PrivateContainer.cs
diff options
context:
space:
mode:
authorj-p <jp.bruyere@live.be>2016-08-05 18:48:09 +0200
committerGitHub <noreply@github.com>2016-08-05 18:48:09 +0200
commitbeba8120aa8f1529d79ccf0f52f02069b02aaf4d (patch)
tree8de343d8341be621c4b5daa12899155e0bc2f26a /src/GraphicObjects/PrivateContainer.cs
parentda0cd66b6af42a3df1f35014617f1e0882ae9e63 (diff)
parentb9e90a3df66f4bd8228c1246af830d7801ea57ba (diff)
Merge pull request #15 from jpbruyere/TemplateImprovments
Template improvments
Diffstat (limited to 'src/GraphicObjects/PrivateContainer.cs')
-rw-r--r--src/GraphicObjects/PrivateContainer.cs56
1 files changed, 9 insertions, 47 deletions
diff --git a/src/GraphicObjects/PrivateContainer.cs b/src/GraphicObjects/PrivateContainer.cs
index 08abf95a..93bae7fa 100644
--- a/src/GraphicObjects/PrivateContainer.cs
+++ b/src/GraphicObjects/PrivateContainer.cs
@@ -63,6 +63,7 @@ namespace Crow
child.Parent = this;
child.LayoutChanged += OnChildLayoutChanges;
contentSize = child.Slot.Size;
+ child.RegisteredLayoutings = LayoutingType.None;
child.RegisterForLayouting (LayoutingType.Sizing);
}
@@ -92,13 +93,6 @@ namespace Crow
return child == goToFind ? true :
child == null ? false : child.Contains(goToFind);
}
- public override void ChildrenLayoutingConstraints (ref LayoutingType layoutType)
- {
- if (Width == Measure.Fit)
- layoutType &= (~LayoutingType.X);
- if (Height == Measure.Fit)
- layoutType &= (~LayoutingType.Y);
- }
public override bool UpdateLayout (LayoutingType layoutType)
{
if (child != null) {
@@ -175,28 +169,15 @@ namespace Crow
}
protected override void UpdateCache (Context ctx)
{
- //ctx.Save ();
-
Rectangle rb = Slot + Parent.ClientRectangle.Position;
using (ImageSurface cache = new ImageSurface (bmp, Format.Argb32, Slot.Width, Slot.Height, 4 * Slot.Width)) {
Context gr = new Context (cache);
- //clip to client zone
- CairoHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius);
- gr.Clip ();
-
if (Clipping.count > 0) {
-
Clipping.clearAndClip (gr);
- if (child != null) {
-
- base.onDraw (gr);
-
-
- child.Paint (ref gr);
- }
+ onDraw (gr);
}
gr.Dispose ();
@@ -205,33 +186,7 @@ namespace Crow
ctx.Paint ();
}
Clipping.Reset();
-
- //ctx.Restore ();
}
-// public override Rectangle ContextCoordinates (Rectangle r)
-// {
-// return
-// Parent.ContextCoordinates(r) + Slot.Position + ClientRectangle.Position;
-// }
-// public override void Paint(ref Cairo.Context ctx)
-// {
-// if (!Visible)//check if necessary??
-// return;
-//
-// ctx.Save();
-//
-// base.Paint(ref ctx);
-//
-// //clip to client zone
-// CairoHelpers.CairoRectangle (ctx, Parent.ContextCoordinates(ClientRectangle + Slot.Position), CornerRadius);
-// ctx.Clip();
-//
-// if (child != null)
-// child.Paint(ref ctx);
-//
-// ctx.Restore();
-// }
-
#endregion
#region Mouse handling
@@ -250,6 +205,13 @@ namespace Crow
child.ClearBinding ();
base.ClearBinding ();
}
+ public override GraphicObject DeepClone ()
+ {
+ PrivateContainer tmp = base.DeepClone () as PrivateContainer;
+ if (child != null)
+ tmp.SetChild (child.DeepClone ());
+ return tmp;
+ }
}
}