Skip to content

Commit

Permalink
Added new navigation system (#511)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo-Peyronnet committed Dec 25, 2023
1 parent ad396d4 commit fecfbd7
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 134 deletions.
44 changes: 44 additions & 0 deletions InternetTest/InternetTest/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,50 @@
</Setter.Value>
</Setter>
</Style>
<Style x:Key="NavBarToolButton" TargetType="{x:Type RadioButton}">
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RadioButton}">
<Border
x:Name="border"
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="5"
SnapsToDevicePixels="true">
<ContentPresenter
x:Name="contentPresenter"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="border" Property="Background" Value="{Binding Source={StaticResource AccentColor}}" />
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{Binding Source={StaticResource WindowButtonsHoverForeground1}}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="border" Property="Background" Value="{Binding Source={StaticResource LightAccentColor}}" />
<Setter TargetName="border" Property="BorderBrush" Value="{Binding Source={StaticResource LightAccentColor}}" />
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{Binding Source={StaticResource AccentColor}}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="border" Property="Background" Value="{Binding Source={StaticResource LightAccentColor}}" />
<Setter TargetName="border" Property="BorderBrush" Value="{Binding Source={StaticResource LightAccentColor}}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter TargetName="border" Property="Background" Value="Transparent" />
<Setter TargetName="border" Property="BorderBrush" Value="Transparent" />
<Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{Binding Source={StaticResource Gray}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TabRadioButton" TargetType="{x:Type RadioButton}">
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
Expand Down
59 changes: 30 additions & 29 deletions InternetTest/InternetTest/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@
</Button.Triggers>
</Button>
<StackPanel x:Name="UtilitiesPanel" Visibility="Collapsed">
<Button
<RadioButton
x:Name="StatusPageBtn"
Margin="10 0 0 0"
Padding="5 2 2 2"
Expand All @@ -541,11 +541,11 @@
BorderThickness="0"
Click="StatusPageBtn_Click"
Content="{x:Static lang:Resources.Status}"
FontSize="10"
FontSize="10" GroupName="NavBar"
FontWeight="ExtraBold"
Foreground="{Binding Source={StaticResource AccentColor}}"
Style="{DynamicResource DefaultButton}" />
<Button
Style="{DynamicResource NavBarToolButton}" />
<RadioButton
x:Name="DownDetectorPageBtn"
Margin="10 0 0 0"
Padding="5 2 2 2"
Expand All @@ -554,11 +554,11 @@
BorderThickness="0"
Click="DownDetectorPageBtn_Click"
Content="{x:Static lang:Resources.DownDetector}"
FontSize="10"
FontSize="10" GroupName="NavBar"
FontWeight="ExtraBold"
Foreground="{Binding Source={StaticResource AccentColor}}"
Style="{DynamicResource DefaultButton}" />
<Button
Style="{DynamicResource NavBarToolButton}" />
<RadioButton
x:Name="DnsPageBtn"
Margin="10 0 0 0"
Padding="5 2 2 2"
Expand All @@ -567,11 +567,11 @@
BorderThickness="0"
Click="DnsPageBtn_Click"
Content="{x:Static lang:Resources.DNSTool}"
FontSize="10"
FontSize="10" GroupName="NavBar"
FontWeight="ExtraBold"
Foreground="{Binding Source={StaticResource AccentColor}}"
Style="{DynamicResource DefaultButton}" />
<Button
Style="{DynamicResource NavBarToolButton}" />
<RadioButton
x:Name="WiFiPageBtn"
Margin="10 0 0 0"
Padding="5 2 2 2"
Expand All @@ -580,10 +580,10 @@
BorderThickness="0"
Click="WiFiPageBtn_Click"
Content="{x:Static lang:Resources.WiFiNetworks}"
FontSize="10"
FontSize="10" GroupName="NavBar"
FontWeight="ExtraBold"
Foreground="{Binding Source={StaticResource AccentColor}}"
Style="{DynamicResource DefaultButton}" />
Style="{DynamicResource NavBarToolButton}" />
</StackPanel>
<Button
x:Name="IPToolsBtn"
Expand Down Expand Up @@ -648,7 +648,7 @@
</Button.Triggers>
</Button>
<StackPanel x:Name="IPPanel" Visibility="Collapsed">
<Button
<RadioButton
x:Name="MyIPPageBtn"
Margin="10 0 0 0"
Padding="5 2 2 2"
Expand All @@ -657,11 +657,11 @@
BorderThickness="0"
Click="MyIPPageBtn_Click"
Content="{x:Static lang:Resources.MyIP}"
FontSize="10"
FontSize="10" GroupName="NavBar"
FontWeight="ExtraBold"
Foreground="{Binding Source={StaticResource AccentColor}}"
Style="{DynamicResource DefaultButton}" />
<Button
Style="{DynamicResource NavBarToolButton}" />
<RadioButton
x:Name="LocateIPPageBtn"
Margin="10 0 0 0"
Padding="5 2 2 2"
Expand All @@ -670,10 +670,10 @@
BorderThickness="0"
Click="LocateIPPageBtn_Click"
Content="{x:Static lang:Resources.LocateIP}"
FontSize="10"
FontSize="10" GroupName="NavBar"
FontWeight="ExtraBold"
Foreground="{Binding Source={StaticResource AccentColor}}"
Style="{DynamicResource DefaultButton}" />
Style="{DynamicResource NavBarToolButton}" />
</StackPanel>
<Button
x:Name="CommandsBtn"
Expand Down Expand Up @@ -749,7 +749,7 @@
</Button.Triggers>
</Button>
<StackPanel x:Name="CommandPanel" Visibility="Collapsed">
<Button
<RadioButton
x:Name="PingPageBtn"
Margin="10 0 0 0"
Padding="5 2 2 2"
Expand All @@ -758,11 +758,11 @@
BorderThickness="0"
Click="PingPageBtn_Click"
Content="{x:Static lang:Resources.Ping}"
FontSize="10"
FontSize="10" GroupName="NavBar"
FontWeight="ExtraBold"
Foreground="{Binding Source={StaticResource AccentColor}}"
Style="{DynamicResource DefaultButton}" />
<Button
Style="{DynamicResource NavBarToolButton}" />
<RadioButton
x:Name="IPConfigPageBtn"
Margin="10 0 0 0"
Padding="5 2 2 2"
Expand All @@ -771,11 +771,11 @@
BorderThickness="0"
Click="IPConfigPageBtn_Click"
Content="{x:Static lang:Resources.IPConfig}"
FontSize="10"
FontSize="10" GroupName="NavBar"
FontWeight="ExtraBold"
Foreground="{Binding Source={StaticResource AccentColor}}"
Style="{DynamicResource DefaultButton}" />
<Button
Style="{DynamicResource NavBarToolButton}" />
<RadioButton
x:Name="TraceroutePageBtn"
Margin="10 0 0 0"
Padding="5 2 2 2"
Expand All @@ -784,11 +784,11 @@
BorderThickness="0"
Click="TraceroutePageBtn_Click"
Content="{x:Static lang:Resources.TraceRoute}"
FontSize="10"
FontSize="10" GroupName="NavBar"
FontWeight="ExtraBold"
Foreground="{Binding Source={StaticResource AccentColor}}"
Style="{DynamicResource DefaultButton}" />
<Button
Style="{DynamicResource NavBarToolButton}" />
<RadioButton
x:Name="WifiPasswordsPageBtn"
Margin="10 0 0 0"
Padding="5 2 2 2"
Expand All @@ -798,9 +798,10 @@
Click="WifiPasswordsPageBtn_Click"
Content="{x:Static lang:Resources.WifiPasswords}"
FontSize="10"
GroupName="NavBar"
FontWeight="ExtraBold"
Foreground="{Binding Source={StaticResource AccentColor}}"
Style="{DynamicResource DefaultButton}" />
Style="{DynamicResource NavBarToolButton}" />
</StackPanel>
</StackPanel>
</ScrollViewer>
Expand Down

0 comments on commit fecfbd7

Please sign in to comment.