From: jpbruyere Date: Mon, 14 Sep 2015 21:15:31 +0000 (+0200) Subject: Color.Clear to make it possible transparency with GroupBox Title X-Git-Tag: 0.2~18 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=b2bef2567b1fa60ec7f9f91ab475fd0e02dbc834;p=jp%2Fcrow.git Color.Clear to make it possible transparency with GroupBox Title without the border over the text test0 to test the concept --- diff --git a/Tests/GOLIBTests.cs b/Tests/GOLIBTests.cs index 2f8eb036..38eaf869 100644 --- a/Tests/GOLIBTests.cs +++ b/Tests/GOLIBTests.cs @@ -31,6 +31,8 @@ namespace test int frameCpt = 0; int idx = 0; string[] testFiles = { + "testWindow.goml", + "test0.goml", "test1.goml", "test1.1.goml", "test1.2.goml", @@ -41,7 +43,6 @@ namespace test "testSpinner.goml", "testPopper.goml", "testExpandable.goml", - "testWindow.goml", "testMsgBox.goml", "testGrid.goml", "fps.goml", diff --git a/Tests/Interfaces/test0.goml b/Tests/Interfaces/test0.goml index b3b629b9..fb23bbcd 100755 --- a/Tests/Interfaces/test0.goml +++ b/Tests/Interfaces/test0.goml @@ -3,16 +3,15 @@ Width="100" Height="100" Top="200" Left="200" Margin="10" Background="Green"/>--> - - - - \ No newline at end of file + + + + + + + + + diff --git a/Tests/Interfaces/testWindow2.goml b/Tests/Interfaces/testWindow2.goml new file mode 100755 index 00000000..b336a9dc --- /dev/null +++ b/Tests/Interfaces/testWindow2.goml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Colors.cs b/src/Colors.cs index 96d17f2a..82f1dfb0 100755 --- a/src/Colors.cs +++ b/src/Colors.cs @@ -150,6 +150,7 @@ namespace go #region Predefined colors public static readonly Color Transparent = new Color(0, 0, 0, 0, "Transparent"); + public static readonly Color Clear = new Color(-1, -1, -1, -1, "Clear"); public static readonly Color Green = new Color(0, 1.0, 0, 1.0, "Green"); public static readonly Color AirForceBlueRaf = new Color(0.364705882352941,0.541176470588235,0.658823529411765,1.0,"AirForceBlueRaf"); public static readonly Color AirForceBlueUsaf = new Color(0,0.188235294117647,0.56078431372549,1.0,"AirForceBlueUsaf"); diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index c3c22e7b..6a146c64 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -664,6 +664,13 @@ namespace go Rectangle rb = Parent.ContextCoordinates(Slot); using (ImageSurface source = new ImageSurface(bmp, Format.Argb32, rb.Width, rb.Height, 4 * Slot.Width)) { + if (this.Background == Color.Clear) { + ctx.Save (); + ctx.Operator = Operator.Clear; + ctx.Rectangle(rb); + ctx.Fill (); + ctx.Restore (); + } ctx.SetSourceSurface (source, rb.X, rb.Y); ctx.Paint (); }