diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-03-27 14:12:47 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-03-27 14:12:47 +0100 |
| commit | 983371d5934520e5a29a105e88ce893eaeca3663 (patch) | |
| tree | ebfed89ac3c7dd4110a82adc06eac9a196e3810a /Samples/common | |
| parent | bb9053da569aceaa3f58a97bfbc42c7a178cf9a1 (diff) | |
wip
Diffstat (limited to 'Samples/common')
| -rw-r--r-- | Samples/common/ui/templates/ColorPicker.template | 93 | ||||
| -rw-r--r-- | Samples/common/ui/templates/TabItem.template | 20 |
2 files changed, 56 insertions, 57 deletions
diff --git a/Samples/common/ui/templates/ColorPicker.template b/Samples/common/ui/templates/ColorPicker.template index 7c5ff263..96d6edbd 100644 --- a/Samples/common/ui/templates/ColorPicker.template +++ b/Samples/common/ui/templates/ColorPicker.template @@ -1,60 +1,39 @@ <?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}"> +<Popper Margin="0" Caption="{./CurrentColor}" Background="{./Background}" > + <Template> + <CheckBox Margin="0" Caption="{./Caption}" IsChecked="{²./IsPopped}" Background="{./Background}"> <Template> - <Scroller Name="scroller1" Margin="5"> - <Wrapper Name="ItemsContainer" Height="Fit" VerticalAlignment="Top"/> - </Scroller> + <HorizontalStack Margin="3" Spacing="3" Background="{./Background}"> + <Border Width="18" Height="12" CornerRadius="3" + Background="{../../../../CurrentColor}"> + </Border> + <Label Width="Stretched" Text="{./Caption}" /> + </HorizontalStack> </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 + </CheckBox> + </Template> + <TabView MinimumSize="{../../MinimumPopupSize}" Width="Fit" Height="Fit" ActivateNewTab="false"> + <TabItem Template="#ui.TabItem.template" Caption="HSV" Width="Fit" Height="Fit"> + <ColorPicker CurrentColor="{²../../../../CurrentColor}" /> + </TabItem> + <TabItem Template="#ui.TabItem.template" Caption="Colors names" SelectedBackground="Jet" Width="Stretched" Height="Stretched"> + <ColorPicker CurrentColor="{²../../../../CurrentColor}" > + <Template> + <ListBox Data="{./AvailableColors}" SelectedItem="{²./CurrentColor}" Width="200" Height="200"> + <!--<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> + </Template> + </ColorPicker> + </TabItem> + </TabView> +</Popper> + diff --git a/Samples/common/ui/templates/TabItem.template b/Samples/common/ui/templates/TabItem.template new file mode 100644 index 00000000..a95b4dbe --- /dev/null +++ b/Samples/common/ui/templates/TabItem.template @@ -0,0 +1,20 @@ +<?xml version="1.0"?> +<GenericStack Orientation="Vertical" Spacing="0" + Background="{./Background}" + MouseEnter="{/caption.Foreground=White}" + MouseLeave="{/caption.Foreground=Grey}"> + <HorizontalStack Margin="2" Left="{./TabOffset}" + Name="TabTitle" + HorizontalAlignment="Left" + Height="{./TabHeight}" + Width="{./TabWidth}"> + <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" + MouseClick="./butCloseTabClick"/> + </Border> + </HorizontalStack> + <Container Name="Content"/> +</GenericStack> + |