]> O.S.I.I.S - jp/crow.git/commitdiff
roslyn editor
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 16 Feb 2020 06:36:48 +0000 (07:36 +0100)
committerj-p <jp_bruyere@hotmail.com>
Sat, 9 May 2020 22:50:02 +0000 (00:50 +0200)
Crow/Templates/TabItem.template
Crow/src/Widgets/ColorPicker.cs
Crow/src/Widgets/IMLContainer.cs
Crow/src/Widgets/TabView.cs
Directory.Build.props
Samples/common/ui/Interfaces/Divers/colorPicker.crow
Samples/common/ui/Interfaces/Divers/colorPicker2.crow [new file with mode: 0644]
Samples/common/ui/templates/ColorPicker.template [new file with mode: 0644]
Samples/common/ui/templates/TabItem.template [deleted file]

index b06c9e427550d5acb37d4188c66dc4770333904d..a95b4dbef9f986577dccb2dcbd8e969900437e08 100644 (file)
@@ -8,7 +8,7 @@
                HorizontalAlignment="Left"
                Height="{./TabHeight}"
                Width="{./TabWidth}">
-               <Label Name="caption" Text="{./Caption}" Foreground="Grey"/>
+               <Label Name="caption" Text="{./Caption}" Foreground="Grey" Width="Stretched"/>
                <Border CornerRadius="5" BorderWidth="1" Foreground="Transparent"  Height="12" Width="12"
                                        MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">
                        <Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Icons.exit2.svg"
index 72f77deae24077928387da58d09d7f1bba933930..e137a35a8dd704404b8a6188caa1bf7761067bba 100644 (file)
@@ -5,6 +5,8 @@
 using System;
 using System.Xml.Serialization;
 using System.ComponentModel;
+using System.Collections.Generic;
+using System.Linq;
 
 namespace Crow
 {
@@ -30,6 +32,8 @@ namespace Crow
                                NotifyValueChanged ("CurrentColor", currentColor);
                        }
                }
+
+               public IList<Color> ColorList => Color.ColorDic.Values.OrderBy (c => c.Hue).ToList ();
        }
 }
 
index 8ba161a6e0acd7b01efe278f950c7ae4105b0e0b..174ef08315dbc131987a1e43ccfad39eedd3ecbb 100644 (file)
@@ -1,28 +1,7 @@
-//
-// IMLContainer.cs
+// Copyright (c) 2013-2020  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
 //
-// Author:
-//       Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+
 using System;
 
 namespace Crow
index 1f9082d477a248871ec647c8b319ad464915ec08..057afa4160cc3f589ed3b738fc891056d537457c 100644 (file)
@@ -1,38 +1,14 @@
-//
-// TabView.cs
+// Copyright (c) 2013-2020  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
 //
-// Author:
-//       Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
 using System;
-using System.Xml.Serialization;
 using System.ComponentModel;
 using Crow.Cairo;
-using System.Diagnostics;
 using System.Linq;
 
 namespace Crow
-{      
+{
        public class TabView : Group
        {
                #region CTOR
index 719386c5aac767485e7dbc4faa5dc502491114ca..34cb5efa78e49bb21e4096c4c9457cb31fa15d81 100644 (file)
@@ -7,7 +7,7 @@
                <Authors>Jean-Philippe Bruyère</Authors>           
                <LangVersion>7.2</LangVersion>
                
-               <CrowVersion>0.8.6</CrowVersion>
+               <CrowVersion>0.8.8</CrowVersion>
                <CrowPackageVersion>$(CrowVersion)-beta</CrowPackageVersion>
        </PropertyGroup>
 </Project>
index afdef146a699eadb9bc3bba2628fe1c5763e452d..92a5c05469e5617908aff7905395bd54aeb784e3 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <VerticalStack>
-       <ColorPicker SelectedColor="{²../go.Background}" Name="colorPicker" Background="DimGrey" Margin="5" Fit="True" />
+       <ColorPicker CurrentColor="{²../go.Background}" Name="colorPicker" Background="DimGrey" Margin="5" Fit="True" />
        <Widget Name="go" Width="100" Height="60" Background="DarkBlue"/>
-       <Widget Name="go" Width="100" Height="60" Background="{../colorPicker.SelectedColor}"/>
-       <Label Text="{../colorPicker.SelectedColor}"/>
+       <Widget Name="go" Width="100" Height="60" Background="{../colorPicker.CurrentColor}"/>
+       <Label Text="{../colorPicker.CurrentColor}"/>
 </VerticalStack>
\ No newline at end of file
diff --git a/Samples/common/ui/Interfaces/Divers/colorPicker2.crow b/Samples/common/ui/Interfaces/Divers/colorPicker2.crow
new file mode 100644 (file)
index 0000000..da1a883
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<VerticalStack>
+       <ColorPicker CurrentColor="{²../go.Background}" Name="colorPicker" Background="DimGrey" Margin="5" Width="300" Template="#ui.ColorPicker.template" />
+       <Widget Name="go" Width="100" Height="60" Background="DarkBlue"/>
+       <Widget Name="go" Width="100" Height="60" Background="{../colorPicker.CurrentColor}"/>
+       <Label Text="{../colorPicker.CurrentColor}"/>
+</VerticalStack>
\ No newline at end of file
diff --git a/Samples/common/ui/templates/ColorPicker.template b/Samples/common/ui/templates/ColorPicker.template
new file mode 100644 (file)
index 0000000..7c5ff26
--- /dev/null
@@ -0,0 +1,60 @@
+<?xml version="1.0"?>
+<TabView SelectedTab="0">
+       <TabItem Caption="HSV">
+               <Border Background="{./Background}"     Foreground="{./Foreground}" Width="Stretched"
+                               CornerRadius="{./CornerRadius}" BorderWidth="1">                
+                       <VerticalStack Margin="2">
+                               <Widget Width="30" Height="16" Background="{./CurrentColor}"/>
+                               <HorizontalStack Height="Fit">
+                                       <Label Style="labColor" Text="R:"/>
+                                       <ColorSlider Name="cs" Component="Red" CurrentColor="{²../../../../../../CurrentColor}"/>
+                                       <Label Style="labColorV" Text="{../cs.CurrentValue}" />
+                               </HorizontalStack>
+                               <HorizontalStack Height="Fit">
+                                       <Label Style="labColor" Text="G:"/>
+                                       <ColorSlider Name="cs" Component="Green" CurrentColor="{²../../../../../../CurrentColor}"/>
+                                       <Label Style="labColorV" Text="{../cs.CurrentValue}" />
+                               </HorizontalStack>
+                               <HorizontalStack Height="Fit">
+                                       <Label Style="labColor" Text="B:"/>
+                                       <ColorSlider Name="cs" Component="Blue" CurrentColor="{²../../../../../../CurrentColor}"/>
+                                       <Label Style="labColorV" Text="{../cs.CurrentValue}" />
+                               </HorizontalStack>
+                               <HorizontalStack Height="Fit">
+                                       <Label Style="labColor" Text="A:"/>
+                                       <ColorSlider Name="cs" Component="Alpha" CurrentColor="{²../../../../../../CurrentColor}"/>
+                                       <Label Style="labColorV" Text="{../cs.CurrentValue}" />
+                               </HorizontalStack>
+                               <HorizontalStack Height="Fit">
+                                       <Label Style="labColor" Text="H:"/>
+                                       <ColorSlider Name="cs" Component="Hue" CurrentColor="{²../../../../../../CurrentColor}"/>
+                                       <Label Style="labColorV" Text="{../cs.CurrentValue}" />
+                               </HorizontalStack>
+                               <HorizontalStack Height="Fit">
+                                       <Label Style="labColor" Text="S:"/>
+                                       <ColorSlider Name="cs" Component="Saturation" CurrentColor="{²../../../../../../CurrentColor}"/>
+                                       <Label Style="labColorV" Text="{../cs.CurrentValue}" />
+                               </HorizontalStack>                      
+                               <HorizontalStack Height="Fit">
+                                       <Label Style="labColor" Text="V:"/>
+                                       <ColorSlider Name="cs" Component="Value" CurrentColor="{²../../../../../../CurrentColor}"/>
+                                       <Label Style="labColorV" Text="{../cs.CurrentValue}" />
+                               </HorizontalStack>
+                       </VerticalStack>                        
+               </Border>
+       </TabItem>
+       <TabItem Caption="List" Height="Stretched">
+               <ListBox Data="{../../../ColorList}" SelectedItem="{²../../../CurrentColor}">
+                       <Template>
+                               <Scroller Name="scroller1" Margin="5">
+                                       <Wrapper Name="ItemsContainer" Height="Fit" VerticalAlignment="Top"/>
+                               </Scroller>
+                       </Template>
+                       <ItemTemplate>
+                               <Border Width="16" Height="16" Background="{}" Foreground="Transparent" Tooltip="{}"
+                                                               MouseEnter="{Foreground=Black}"
+                                                               MouseLeave="{Foreground=Transparent}"/> 
+                       </ItemTemplate>
+               </ListBox>
+       </TabItem>
+</TabView>
\ No newline at end of file
diff --git a/Samples/common/ui/templates/TabItem.template b/Samples/common/ui/templates/TabItem.template
deleted file mode 100644 (file)
index fd0f310..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0"?>
-<GenericStack Orientation="Vertical" Spacing="0"
-               Background="{./Background}"
-               MouseEnter="{/caption.Foreground=White}"
-               MouseLeave="{/caption.Foreground=Grey}">
-       <HorizontalStack Left="{./TabOffset}"
-               Name="TabTitle"
-               HorizontalAlignment="Left"
-               Height="{./TabHeight}"
-               Width="{./TabWidth}">
-               <Label Name="caption" Text="{./Caption}" Foreground="Grey" Width="Stretched"/>
-               <Label Text="{./ViewIndex}" Foreground="Green"/>
-               <Label Text="{./TabOffset}" Foreground="Red"/>
-               <Border CornerRadius="5" BorderWidth="1" Foreground="Transparent"  Height="12" Width="12"
-                                       MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">
-                       <Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Icons.exit2.svg"
-                                MouseClick="./butCloseTabClick"/>
-               </Border>
-       </HorizontalStack>
-       <Container Margin="20">
-               <Container Background="DimGrey" Name="Content"/>
-       </Container>
-</GenericStack>
-