diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-02-16 07:36:48 +0100 |
|---|---|---|
| committer | j-p <jp_bruyere@hotmail.com> | 2020-05-10 00:50:02 +0200 |
| commit | 78ff96edf53ba273aa157a5bda2aa5b7a10f1c5f (patch) | |
| tree | 90250c94b0ca8ddcb55ad11962dbe31e129e586f | |
| parent | 701e6c825abbfb431bda3f6692e32a5f12e7307b (diff) | |
roslyn editor
| -rw-r--r-- | Crow/Templates/TabItem.template | 2 | ||||
| -rw-r--r-- | Crow/src/Widgets/ColorPicker.cs | 4 | ||||
| -rw-r--r-- | Crow/src/Widgets/IMLContainer.cs | 27 | ||||
| -rw-r--r-- | Crow/src/Widgets/TabView.cs | 30 | ||||
| -rw-r--r-- | Directory.Build.props | 2 | ||||
| -rw-r--r-- | Samples/common/ui/Interfaces/Divers/colorPicker.crow | 6 | ||||
| -rw-r--r-- | Samples/common/ui/Interfaces/Divers/colorPicker2.crow | 7 | ||||
| -rw-r--r-- | Samples/common/ui/templates/ColorPicker.template | 60 | ||||
| -rw-r--r-- | Samples/common/ui/templates/TabItem.template | 24 |
9 files changed, 82 insertions, 80 deletions
diff --git a/Crow/Templates/TabItem.template b/Crow/Templates/TabItem.template index b06c9e42..a95b4dbe 100644 --- a/Crow/Templates/TabItem.template +++ b/Crow/Templates/TabItem.template @@ -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" diff --git a/Crow/src/Widgets/ColorPicker.cs b/Crow/src/Widgets/ColorPicker.cs index 72f77dea..e137a35a 100644 --- a/Crow/src/Widgets/ColorPicker.cs +++ b/Crow/src/Widgets/ColorPicker.cs @@ -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 (); } } diff --git a/Crow/src/Widgets/IMLContainer.cs b/Crow/src/Widgets/IMLContainer.cs index 8ba161a6..174ef083 100644 --- a/Crow/src/Widgets/IMLContainer.cs +++ b/Crow/src/Widgets/IMLContainer.cs @@ -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 diff --git a/Crow/src/Widgets/TabView.cs b/Crow/src/Widgets/TabView.cs index 1f9082d4..057afa41 100644 --- a/Crow/src/Widgets/TabView.cs +++ b/Crow/src/Widgets/TabView.cs @@ -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 diff --git a/Directory.Build.props b/Directory.Build.props index 719386c5..34cb5efa 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -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> diff --git a/Samples/common/ui/Interfaces/Divers/colorPicker.crow b/Samples/common/ui/Interfaces/Divers/colorPicker.crow index afdef146..92a5c054 100644 --- a/Samples/common/ui/Interfaces/Divers/colorPicker.crow +++ b/Samples/common/ui/Interfaces/Divers/colorPicker.crow @@ -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 index 00000000..da1a8830 --- /dev/null +++ b/Samples/common/ui/Interfaces/Divers/colorPicker2.crow @@ -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 index 00000000..7c5ff263 --- /dev/null +++ b/Samples/common/ui/templates/ColorPicker.template @@ -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 index fd0f310d..00000000 --- a/Samples/common/ui/templates/TabItem.template +++ /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> - |