]> O.S.I.I.S - jp/crow.git/commitdiff
debug
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 13 Aug 2017 06:17:58 +0000 (08:17 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 13 Aug 2017 06:17:58 +0000 (08:17 +0200)
Templates/DirectoryView.template
Tests/Showcase.cs
src/Size.cs

index 12c8915c83e5b3ba4bc1202f097396fa7231e536..bf3a6f46bfa3cdfe57ce1bb89c5a2bdc1e244017 100755 (executable)
@@ -2,33 +2,36 @@
 <TreeView IsRoot="true" Name="treeView" Data="{./FileSystemEntries}" Background="{./Background}"
                SelectedItemChanged="./onSelectedItemChanged">
        <ItemTemplate DataType="System.IO.FileInfo">
-               <HorizontalStack Focusable="true"  Height="Fit" Width="Stretched" >
-                       <Image Margin="2" Width="14" Height="14"
-                               Path="#Crow.Icons.file.svg"/>
-                       <Label Text="{Name}" Width="Stretched"
-                               MouseEnter="{Background=vgradient|0:White|0.05:UnitedNationsBlue|1:Jet}"
-                               MouseLeave="{Background=Transparent}"/>
-               </HorizontalStack>
+               <Border CornerRadius="2" Margin="0" Focusable="true"  Height="Fit" Width="Stretched" Foreground="Transparent"
+                               MouseEnter="{Foreground=DimGray}"
+                               MouseLeave="{Foreground=Transparent}">
+                       <HorizontalStack>
+                               <Image Margin="1" Width="14" Height="14"
+                                       Path="#Crow.Icons.file.svg"/>
+                               <Label Text="{Name}" Width="Stretched"/>
+                       </HorizontalStack>
+               </Border>
        </ItemTemplate>
        <ItemTemplate DataType="System.IO.DirectoryInfo" Data="GetFileSystemInfos">
                <Expandable Caption="{Name}" >
                        <Template>
                                <VerticalStack>
-                                       <HorizontalStack Spacing="1" Height="Fit" MouseDoubleClick="./onClickForExpand"
-                                                       MouseEnter="{Background=vgradient|0:White|0.05:UnitedNationsBlue|1:Jet}"
-                                                       MouseLeave="{Background=Transparent}">
-                                               <Container Margin="1" Width="10" Height="10" Focusable="true" MouseClick="./onClickForExpand"
-                                                       MouseEnter="{Background=LightGray}"
-                                                       MouseLeave="{Background=Transparent}">
-                                                       <Image
+                                       <Border CornerRadius="2" Margin="0" Height="Fit" MouseDoubleClick="./onClickForExpand"
+                                                       Foreground="Transparent"
+                                                       MouseEnter="{Foreground=DimGray}"
+                                                       MouseLeave="{Foreground=Transparent}">
+                                               <HorizontalStack Spacing="1">
+                                                       <Image Margin="1" Width="10" Height="10" Focusable="true" MouseClick="./onClickForExpand"
                                                                Path="{./Image}"
                                                                Visible="{./IsExpandable}"
-                                                               SvgSub="{./IsExpanded}"/>
-                                               </Container>
-                                               <Image Margin="2" Width="14" Height="14"
-                                                       Path="#Crow.Icons.folder.svg"/>
-                                               <Label Text="{./Caption}"/>
-                                       </HorizontalStack>
+                                                               SvgSub="{./IsExpanded}"
+                                                               MouseEnter="{Background=LightGray}"
+                                                               MouseLeave="{Background=Transparent}"/>
+                                                       <Image Margin="1" Width="14" Height="14"
+                                                               Path="#Crow.Icons.folder.svg"/>
+                                                       <Label Text="{./Caption}"/>
+                                               </HorizontalStack>
+                                       </Border>
                                        <Container Name="Content" Visible="false"/>
                                </VerticalStack>
                        </Template>
index 517f722d1e12fd9ea708356052992afc5d60c847..ad57222f82b60ad98a59d62ff22bb3ddfffbf01a 100644 (file)
@@ -67,7 +67,9 @@ namespace Tests
                {
                        FileSystemInfo fi = e.NewValue as FileSystemInfo;
                        if (fi == null)
-                               return;                 
+                               return;
+                       if (fi is DirectoryInfo)
+                               return;
                        lock (this.ifaceControl [0].CrowInterface.UpdateMutex) {
                                GraphicObject g = this.ifaceControl [0].CrowInterface.Load (fi.FullName);
                                crowContainer.SetChild (g);
index 47288b0695b6a0d4726fd139628ac51ddd45ba42..ccd1ab312566995a3d8aa7d4bdb56996c6f0f40a 100644 (file)
@@ -126,7 +126,15 @@ namespace Crow
                {
                        return s.Width <= i && s.Height <= i ? true : false;
                }
-        public static bool operator <=(Size s1, Size s2)
+               public static bool operator >(Size s, int i)
+               {
+                       return s.Width > i && s.Height > i ? true : false;
+               }
+               public static bool operator >=(Size s, int i)
+               {
+                       return s.Width >= i && s.Height >= i ? true : false;
+               }
+               public static bool operator <=(Size s1, Size s2)
         {
             if (s1.Width <= s2.Width && s1.Height <= s2.Height)
                 return true;