]> O.S.I.I.S - jp/crow.git/commitdiff
Draw borders inside Margin, this allow single level of border with
authorjpbruyere <jp.bruyere@hotmail.com>
Mon, 14 Sep 2015 07:58:46 +0000 (09:58 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Mon, 14 Sep 2015 07:58:46 +0000 (09:58 +0200)
margin, Background will mostly be set in child of border,
if not border will have a background outside = Margin width

Templates/Window.goml
src/GraphicObjects/Border.cs

index 55c85f3dc7d87cc73d2a5cfe83a5aebd89194a96..2f3711f1a09b1613bda59eb58b8ebfd8f63a81ab 100755 (executable)
@@ -6,7 +6,7 @@
                                <GraphicObject Width="5"/>\r
                                <Image Name="Image" Margin="1" Width="12" Height="12" Path="#go.Images.Icons.tetra.png"/>\r
                                <Label Foreground="White" Width="0" Name="Title" Margin="1" TextAlignment="Center" />\r
-                               <Border CornerRadius="6" BorderWidth="1" Margin="0" BorderColor="Transparent"  Height="12" Width="12"\r
+                               <Border CornerRadius="6" BorderWidth="1" BorderColor="Transparent"  Height="12" Width="12"\r
                                        MouseEnter="{BorderColor=White}" MouseLeave="{BorderColor=Transparent}">\r
                                        <Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0" Path="#go.Images.Icons.exit2.svg"\r
                                                 MouseClick="butQuitPress"/>\r
index 3f9772675e94e12f3c7f458ab32564ff27af469f..1bc2b7291f3fb2a887a0bd16b8da263351879fa7 100644 (file)
@@ -51,18 +51,18 @@ namespace go
                {
                        Rectangle rBack = new Rectangle (Slot.Size);
 
+                       rBack.Inflate (-Margin);
                        if (BorderWidth > 0) 
-                               rBack.Inflate (-BorderWidth / 2);
+                               rBack.Inflate (-BorderWidth / 2);                       
 
                        gr.Color = Background;
                        CairoHelpers.CairoRectangle(gr,rBack,CornerRadius);
                        gr.Fill ();
 
                        if (BorderWidth > 0) {
-
                                gr.LineWidth = BorderWidth;
                                gr.Color = BorderColor;
-                               CairoHelpers.CairoRectangle(gr,rBack,CornerRadius);
+                               CairoHelpers.CairoRectangle(gr, rBack, CornerRadius);
                                gr.Stroke ();
                        }
                }