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"
using System;
using System.Xml.Serialization;
using System.ComponentModel;
+using System.Collections.Generic;
+using System.Linq;
namespace Crow
{
NotifyValueChanged ("CurrentColor", currentColor);
}
}
+
+ public IList<Color> ColorList => Color.ColorDic.Values.OrderBy (c => c.Hue).ToList ();
}
}
-//
-// 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
-//
-// 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
<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>
<?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
--- /dev/null
+<?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
--- /dev/null
+<?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
+++ /dev/null
-<?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>
-