]> O.S.I.I.S - jp/crow.git/commitdiff
styling, checkbox used in popper
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 17 Feb 2018 02:20:18 +0000 (03:20 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 17 Feb 2018 02:20:18 +0000 (03:20 +0100)
Default.style
Templates/Expandable.template
Templates/MenuItem.template
Templates/Popper.template
Tests/Interfaces/Divers/0.crow

index 4eaabf4ca6c070351048aa953b39057719c20280..887ecc9fd8fa28fefa5d041dea2bc47212a81bfb 100644 (file)
@@ -9,8 +9,25 @@ Border {
 CheckBox { Caption = CheckBox; }
 RadioButton { Caption = RadioButton; }
 Expandable { Caption = Expandable; }
-Popper { Caption = Popper; }
+Popper { Caption = Popper;}
 GroupBox { Caption = Group Box; }
+
+ControlBorder {
+       BorderWidth     = 1;
+       Foreground  = Jet;
+       Background      = Transparent;
+}
+ControlCaption {
+       Foreground  = Gray;
+       MouseEnter      = {Foreground=White};
+       MouseLeave      = {Foreground=Gray};
+}
+Icon {
+       Margin=1;
+       Width=12;
+       Height=12;
+}
+
 Wrapper {
        Orientation = Vertical;
 }
@@ -116,11 +133,6 @@ ScrollBar {
 Scroller {
        CacheEnabled = false;
 }
-Icon {
-       Margin=1;
-       Width=12;
-       Height=12;
-}
 Control {
        Margin=0;
        Spacing=3;
index 610caf5c10040e5dc71db3e67000442f218637d3..c5dd1d83d6972eb25f44ade5e37a78af4cc486b9 100755 (executable)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<Border BorderWidth="1" Foreground="{./Foreground}" Background="{./Background}">
+<Border Style="ControlBorder" Foreground="{./Foreground}" Background="{./Background}">
        <VerticalStack>
                <HorizontalStack Spacing="1" Height="Fit" MouseDoubleClick="./onClickForExpand">
                        <Container Margin="1" Width="9" Height="9" Focusable="true" MouseClick="./onClickForExpand"
@@ -10,7 +10,7 @@
                                        Visible="{./IsExpandable}"
                                        SvgSub="{./IsExpanded}"/>
                        </Container>
-                       <Label Text="{./Caption}"/>
+                       <Label Style="ControlCaption" Text="{./Caption}"/>
                </HorizontalStack>
                <Container Name="Content" Visible="false"/>
        </VerticalStack>
index 511c52657310593bc97276c6a9bdef0d999b4898..57014577fbf3c656dc63fde8d7976a5b52567580 100644 (file)
@@ -3,19 +3,23 @@
        Foreground = "{./Foreground}" CanPop="{./HasChildren}" MouseClick="./onMI_Click"
        IsPopped="{²./IsOpened}" PopWidth="{./PopWidth}" PopHeight="{./PopHeight}">
        <Template>
-               <Border Name="border1"
-                               MouseEnter="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
-                               MouseLeave="{Foreground=Transparent}"
-                               MouseDown="{Foreground=vgradient|0:Black|0.05:Gray|0.85:Gray|1:White}"
-                               MouseUp="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
-                               MinimumSize = "60,0"
-                               Foreground="Transparent"
-                               Background="{./Background}">
-                               <Label Text="{./Caption}"
-                                       Foreground="{./Foreground}"
-                                       Margin="2" HorizontalAlignment="Left"
-                                       Font="{./Font}" />
-               </Border>
+               <CheckBox IsChecked="{²./IsPopped}" Caption="{./Caption}" Background="{./Background}" Foreground="{./Foreground}">
+                       <Template>              
+                               <Border Name="border1"
+                                               MouseEnter="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
+                                               MouseLeave="{Foreground=Transparent}"
+                                               MouseDown="{Foreground=vgradient|0:Black|0.05:Gray|0.85:Gray|1:White}"
+                                               MouseUp="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
+                                               MinimumSize = "60,0"
+                                               Foreground="Transparent"
+                                               Background="{./Background}">
+                                               <Label Text="{./Caption}"
+                                                       Foreground="{./Foreground}"
+                                                       Margin="2" HorizontalAlignment="Left"
+                                                       Font="{./Font}" />
+                               </Border>
+                       </Template>             
+               </CheckBox>
        </Template>
        <Border Foreground="DimGray" Width="{../PopWidth}" Height="{../PopHeight}" Background="Onyx">
                <VerticalStack Name="ItemsContainer"/>
index 0bc7c741405bc5bea8375e4a26afbdd114a3d51a..78a6084216168ead92164e142bc5360c2e4a410c 100755 (executable)
@@ -1,8 +1,14 @@
 <?xml version="1.0"?>
-<Border Background="{./Background}" BorderWidth="1" Foreground="{./Foreground}" Height="Fit">
-       <HorizontalStack Spacing="1" Height="Fit">
-               <Image Style="Icon" Margin="1" Width="9" Height="9"
-                               Path="#Crow.Images.Icons.expandable.svg" SvgSub="{./IsPopped}"/>
-               <Label Text="{./Caption}" />
-       </HorizontalStack>
-</Border>
\ No newline at end of file
+<CheckBox Caption="{./Caption}" IsChecked="{²./IsPopped}" Foreground="{./Foreground}" Background="{./Background}">
+       <Template>
+               <Border Style="ControlBorder" Foreground="{./Foreground}" Background="{./Background}">
+                       <HorizontalStack Spacing="1">
+                               <Image Style="Icon" Margin="1" Width="9" Height="9"     
+                                       MouseEnter="{Background=White}" MouseLeave="{Background=Transparent}"
+                                       Background="{./Background}"
+                                       Path="#Crow.Images.Icons.expandable.svg" SvgSub="{./IsChecked}"/>
+                               <Label Style="ControlCaption" Text="{./Caption}" />
+                       </HorizontalStack>
+               </Border>
+       </Template>
+</CheckBox>
index dbb1420d102fcbce1fd643e304494cb58238da6d..4290079279defe33729188c478ca63379521f678 100755 (executable)
                </VerticalStack>
                <Splitter/>
                <VerticalStack Width="40%" Margin="5" Spacing="5">
-                       <Expandable Background="DimGray">
+                       <Expandable>
                                <Image Path="#Crow.Images.Icons.crow.svg"/>
                        </Expandable>
-                       <Popper Background="DimGray" >
+                       <Popper>
                                <Border Fit="True" Background="DimGray" CornerRadius="0" BorderWidth="1">
                                        <Image Path="#Crow.Images.Icons.crow.svg" Width="100" Height="100" Margin="10"
                                                MouseEnter="{Background=LightGray}"