diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-11-01 17:41:21 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-11-01 17:41:21 +0100 |
| commit | f75d82053d9ac440a655860d7d815e418e8e0cf9 (patch) | |
| tree | a665e7d46b06b80a94c01453b0974e60384cbd1d | |
| parent | fe8c1b41ea3c994a8d31d95eefe3ddf7a92b66d2 (diff) | |
restore update and polling intervals to normal value for showcase
| -rw-r--r-- | Samples/ShowCase/ShowCase.cs | 23 | ||||
| -rw-r--r-- | Samples/ShowCase/ui/Button.template | 4 | ||||
| -rw-r--r-- | Samples/ShowCase/ui/showcase.crow | 4 | ||||
| -rw-r--r-- | Samples/common/ui/Interfaces/Experimental/updateIntervals.crow | 8 | ||||
| -rw-r--r-- | Samples/common/ui/templates/slider.tmp | 11 |
5 files changed, 44 insertions, 6 deletions
diff --git a/Samples/ShowCase/ShowCase.cs b/Samples/ShowCase/ShowCase.cs index 6774314a..7b25d718 100644 --- a/Samples/ShowCase/ShowCase.cs +++ b/Samples/ShowCase/ShowCase.cs @@ -37,8 +37,8 @@ namespace ShowCase app.SetWindowIcon ("#Crow.Icons.crow.png"); //app.Theme = @"C:\Users\Jean-Philippe\source\Crow\Themes\TestTheme"; CurrentProgramInstance = app; - Interface.UPDATE_INTERVAL = 50; - Interface.POLLING_INTERVAL = 5; + //Interface.UPDATE_INTERVAL = 50; + //Interface.POLLING_INTERVAL = 5; app.Run (); } @@ -169,5 +169,24 @@ namespace ShowCase } return base.OnKeyDown (e); } + + public int CrowUpdateInterval { + get => Crow.Interface.UPDATE_INTERVAL; + set { + if (Crow.Interface.UPDATE_INTERVAL == value) + return; + Crow.Interface.UPDATE_INTERVAL = value; + NotifyValueChanged (Crow.Interface.UPDATE_INTERVAL); + } + } + public int CrowPollingInterval { + get => Crow.Interface.POLLING_INTERVAL; + set { + if (Crow.Interface.POLLING_INTERVAL == value) + return; + Crow.Interface.POLLING_INTERVAL = value; + NotifyValueChanged (Crow.Interface.POLLING_INTERVAL); + } + } } }
\ No newline at end of file diff --git a/Samples/ShowCase/ui/Button.template b/Samples/ShowCase/ui/Button.template index 9ef1001d..b05567ac 100644 --- a/Samples/ShowCase/ui/Button.template +++ b/Samples/ShowCase/ui/Button.template @@ -5,8 +5,8 @@ MouseLeave="{Foreground=Transparent};{caption.Foreground=LightGrey}" MouseDown="{Foreground=vgradient|0:Black|0.05:Grey|0.85:Grey|1:White}" MouseUp="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black}"> - <HorizontalStack Margin="2"> + <HorizontalStack Margin="1"> <Image Style="Icon" Path="{./Icon}"/> - <Label Font="{./Font}" Name="caption" Margin="3" Foreground="LightGrey" Text="{./Caption}"/> + <Label Font="{./Font}" Name="caption" Margin="2" Foreground="LightGrey" Text="{./Caption}"/> </HorizontalStack> </Border>
\ No newline at end of file diff --git a/Samples/ShowCase/ui/showcase.crow b/Samples/ShowCase/ui/showcase.crow index 692ce88e..c5b683da 100644 --- a/Samples/ShowCase/ui/showcase.crow +++ b/Samples/ShowCase/ui/showcase.crow @@ -136,13 +136,13 @@ </Popper> <Popper Caption="Template" Width="Fit" Background="Onyx"> <Template> - <Border Background="{./Background}" MinimumSize="50,20" Name="Content" Width="Stretched" Margin="3" + <Border Background="{./Background}" MinimumSize="50,20" Name="Content" Width="Stretched" Margin="0" Foreground="Transparent" CornerRadius="{../CornerRadius}" BorderWidth="1" MouseEnter="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black};{caption.Foreground=White}" MouseLeave="{Foreground=Transparent};{caption.Foreground=LightGrey}" MouseDown="{Foreground=vgradient|0:Black|0.05:Grey|0.85:Grey|1:White}" MouseUp="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black}"> - <Label Font="{./Font}" Name="caption" Margin="3" Foreground="LightGrey" Text="{./Caption}"/> + <Label Font="{./Font}" Name="caption" Margin="2" Foreground="LightGrey" Text="{./Caption}"/> </Border> </Template> <VerticalStack Width="200" Height="200" Background="Jet" Margin="5"> diff --git a/Samples/common/ui/Interfaces/Experimental/updateIntervals.crow b/Samples/common/ui/Interfaces/Experimental/updateIntervals.crow new file mode 100644 index 00000000..39261a14 --- /dev/null +++ b/Samples/common/ui/Interfaces/Experimental/updateIntervals.crow @@ -0,0 +1,8 @@ +<VerticalStack Margin="20"> + <Slider Template="#ui.slider.tmp" Height="Fit" Background="0.1,0.1,0.2,0.8" + Minimum="1" Maximum="50" SmallIncrement="1" LargeIncrement="10" + Caption="Crow Update Interval (ms)" Value="{²CrowUpdateInterval}" /> + <Slider Template="#ui.slider.tmp" Height="Fit" Background="0.1,0.1,0.2,0.8" + Minimum="1" Maximum="50" SmallIncrement="1" LargeIncrement="10" + Caption="GLFW polling Interval (ms)" Value="{²CrowPollingInterval}" /> +</VerticalStack>
\ No newline at end of file diff --git a/Samples/common/ui/templates/slider.tmp b/Samples/common/ui/templates/slider.tmp new file mode 100644 index 00000000..d60e66c5 --- /dev/null +++ b/Samples/common/ui/templates/slider.tmp @@ -0,0 +1,11 @@ +<VerticalStack Background="{./Background}" Margin="5"> + <Label Text="{./Caption}"/> + <Group Height="20"> + <Gauge Height="50%" Foreground="${ControlHighlight}" Background="Onyx" Value="{./Value}" Maximum="{./Maximum}" Minimum="{Minimum}" Orientation="{./Orientation}"/> + <Border Name="Cursor" Background="White" BorderWidth="2" Foreground="Grey" + MouseEnter="{Foreground=${ControlHighlight}}" + MouseLeave="{Foreground=Grey}" > + <Label Text="{./Value}" Foreground="Black"/> + </Border> + </Group> +</VerticalStack> |