Refine nav state visuals with active icon highlight
This commit is contained in:
@@ -212,7 +212,7 @@
|
|||||||
<EventSetter Event="Loaded"
|
<EventSetter Event="Loaded"
|
||||||
Handler="Button_Loaded" />
|
Handler="Button_Loaded" />
|
||||||
<Setter Property="Background"
|
<Setter Property="Background"
|
||||||
Value="{DynamicResource inactiveButtonColor}" />
|
Value="Transparent" />
|
||||||
<Setter Property="Foreground"
|
<Setter Property="Foreground"
|
||||||
Value="{DynamicResource navForeground}" />
|
Value="{DynamicResource navForeground}" />
|
||||||
<Setter Property="BorderBrush"
|
<Setter Property="BorderBrush"
|
||||||
@@ -525,6 +525,7 @@
|
|||||||
<Border Visibility="Hidden"
|
<Border Visibility="Hidden"
|
||||||
Tag="ActiveIndicator"
|
Tag="ActiveIndicator"
|
||||||
Panel.ZIndex="1001"
|
Panel.ZIndex="1001"
|
||||||
|
Opacity="0"
|
||||||
Width="4"
|
Width="4"
|
||||||
Height="34"
|
Height="34"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
@@ -542,6 +543,9 @@
|
|||||||
ClipToBounds="False"
|
ClipToBounds="False"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center">
|
VerticalAlignment="Center">
|
||||||
|
<Grid Width="34"
|
||||||
|
Height="34"
|
||||||
|
Margin="14">
|
||||||
<Image Source="{DynamicResource nav_appbar_newspaper}"
|
<Image Source="{DynamicResource nav_appbar_newspaper}"
|
||||||
Panel.ZIndex="18"
|
Panel.ZIndex="18"
|
||||||
Tag="ICO"
|
Tag="ICO"
|
||||||
@@ -551,8 +555,19 @@
|
|||||||
Width="34"
|
Width="34"
|
||||||
Height="34"
|
Height="34"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center" />
|
||||||
Margin="14" />
|
<Rectangle Tag="ActiveIcon"
|
||||||
|
Visibility="Hidden"
|
||||||
|
Panel.ZIndex="19"
|
||||||
|
Width="34"
|
||||||
|
Height="34"
|
||||||
|
Fill="{DynamicResource accentColor}">
|
||||||
|
<Rectangle.OpacityMask>
|
||||||
|
<ImageBrush ImageSource="{DynamicResource nav_appbar_newspaper}"
|
||||||
|
Stretch="Fill" />
|
||||||
|
</Rectangle.OpacityMask>
|
||||||
|
</Rectangle>
|
||||||
|
</Grid>
|
||||||
<Image Source="Resources/StateOverlays/OverlayNewContentButton.png"
|
<Image Source="Resources/StateOverlays/OverlayNewContentButton.png"
|
||||||
Visibility="Collapsed"
|
Visibility="Collapsed"
|
||||||
Panel.ZIndex="18"
|
Panel.ZIndex="18"
|
||||||
@@ -585,6 +600,7 @@
|
|||||||
<Border Visibility="Hidden"
|
<Border Visibility="Hidden"
|
||||||
Tag="ActiveIndicator"
|
Tag="ActiveIndicator"
|
||||||
Panel.ZIndex="1001"
|
Panel.ZIndex="1001"
|
||||||
|
Opacity="0"
|
||||||
Width="4"
|
Width="4"
|
||||||
Height="34"
|
Height="34"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
@@ -600,6 +616,9 @@
|
|||||||
<StackPanel x:Name="StackPanel"
|
<StackPanel x:Name="StackPanel"
|
||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
Background="Transparent">
|
Background="Transparent">
|
||||||
|
<Grid Width="34"
|
||||||
|
Height="34"
|
||||||
|
Margin="14">
|
||||||
<Image Source="{DynamicResource nav_appbar_clipboard_variant_text}"
|
<Image Source="{DynamicResource nav_appbar_clipboard_variant_text}"
|
||||||
x:Name="icoInc"
|
x:Name="icoInc"
|
||||||
Tag="ICO"
|
Tag="ICO"
|
||||||
@@ -607,8 +626,19 @@
|
|||||||
Panel.ZIndex="18"
|
Panel.ZIndex="18"
|
||||||
Style="{StaticResource ImageStyle}"
|
Style="{StaticResource ImageStyle}"
|
||||||
Width="34"
|
Width="34"
|
||||||
|
Height="34" />
|
||||||
|
<Rectangle Tag="ActiveIcon"
|
||||||
|
Visibility="Hidden"
|
||||||
|
Panel.ZIndex="19"
|
||||||
|
Width="34"
|
||||||
Height="34"
|
Height="34"
|
||||||
Margin="14" />
|
Fill="{DynamicResource accentColor}">
|
||||||
|
<Rectangle.OpacityMask>
|
||||||
|
<ImageBrush ImageSource="{DynamicResource nav_appbar_clipboard_variant_text}"
|
||||||
|
Stretch="Fill" />
|
||||||
|
</Rectangle.OpacityMask>
|
||||||
|
</Rectangle>
|
||||||
|
</Grid>
|
||||||
<Image Source="Resources/StateOverlays/OverlayNewContentButton.png"
|
<Image Source="Resources/StateOverlays/OverlayNewContentButton.png"
|
||||||
Visibility="Collapsed"
|
Visibility="Collapsed"
|
||||||
Panel.ZIndex="18"
|
Panel.ZIndex="18"
|
||||||
@@ -641,6 +671,7 @@
|
|||||||
<Border Visibility="Hidden"
|
<Border Visibility="Hidden"
|
||||||
Tag="ActiveIndicator"
|
Tag="ActiveIndicator"
|
||||||
Panel.ZIndex="1001"
|
Panel.ZIndex="1001"
|
||||||
|
Opacity="0"
|
||||||
Width="4"
|
Width="4"
|
||||||
Height="34"
|
Height="34"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
@@ -655,6 +686,9 @@
|
|||||||
</Button.Template>
|
</Button.Template>
|
||||||
<StackPanel Orientation="Horizontal"
|
<StackPanel Orientation="Horizontal"
|
||||||
Background="Transparent">
|
Background="Transparent">
|
||||||
|
<Grid Width="34"
|
||||||
|
Height="34"
|
||||||
|
Margin="14">
|
||||||
<Image Source="{DynamicResource nav_appbar_cart}"
|
<Image Source="{DynamicResource nav_appbar_cart}"
|
||||||
x:Name="icoSSP"
|
x:Name="icoSSP"
|
||||||
Stretch="fill"
|
Stretch="fill"
|
||||||
@@ -662,8 +696,19 @@
|
|||||||
Style="{StaticResource ImageStyle}"
|
Style="{StaticResource ImageStyle}"
|
||||||
Width="34"
|
Width="34"
|
||||||
Height="34"
|
Height="34"
|
||||||
Margin="14"
|
|
||||||
Tag="ICO" />
|
Tag="ICO" />
|
||||||
|
<Rectangle Tag="ActiveIcon"
|
||||||
|
Visibility="Hidden"
|
||||||
|
Panel.ZIndex="19"
|
||||||
|
Width="34"
|
||||||
|
Height="34"
|
||||||
|
Fill="{DynamicResource accentColor}">
|
||||||
|
<Rectangle.OpacityMask>
|
||||||
|
<ImageBrush ImageSource="{DynamicResource nav_appbar_cart}"
|
||||||
|
Stretch="Fill" />
|
||||||
|
</Rectangle.OpacityMask>
|
||||||
|
</Rectangle>
|
||||||
|
</Grid>
|
||||||
<Image Source="Resources/StateOverlays/OverlayNewContentButton.png"
|
<Image Source="Resources/StateOverlays/OverlayNewContentButton.png"
|
||||||
Visibility="Collapsed"
|
Visibility="Collapsed"
|
||||||
Panel.ZIndex="18"
|
Panel.ZIndex="18"
|
||||||
@@ -697,6 +742,7 @@
|
|||||||
<Border Visibility="Hidden"
|
<Border Visibility="Hidden"
|
||||||
Tag="ActiveIndicator"
|
Tag="ActiveIndicator"
|
||||||
Panel.ZIndex="1001"
|
Panel.ZIndex="1001"
|
||||||
|
Opacity="0"
|
||||||
Width="4"
|
Width="4"
|
||||||
Height="34"
|
Height="34"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
@@ -711,6 +757,9 @@
|
|||||||
</Button.Template>
|
</Button.Template>
|
||||||
<StackPanel Orientation="Horizontal"
|
<StackPanel Orientation="Horizontal"
|
||||||
Background="Transparent">
|
Background="Transparent">
|
||||||
|
<Grid Width="34"
|
||||||
|
Height="34"
|
||||||
|
Margin="14">
|
||||||
<Image Source="{DynamicResource nav_appbar_star}"
|
<Image Source="{DynamicResource nav_appbar_star}"
|
||||||
x:Name="icoCustomLinks"
|
x:Name="icoCustomLinks"
|
||||||
Tag="ICO"
|
Tag="ICO"
|
||||||
@@ -718,8 +767,19 @@
|
|||||||
Panel.ZIndex="18"
|
Panel.ZIndex="18"
|
||||||
Style="{StaticResource ImageStyle}"
|
Style="{StaticResource ImageStyle}"
|
||||||
Width="34"
|
Width="34"
|
||||||
|
Height="34" />
|
||||||
|
<Rectangle Tag="ActiveIcon"
|
||||||
|
Visibility="Hidden"
|
||||||
|
Panel.ZIndex="19"
|
||||||
|
Width="34"
|
||||||
Height="34"
|
Height="34"
|
||||||
Margin="14" />
|
Fill="{DynamicResource accentColor}">
|
||||||
|
<Rectangle.OpacityMask>
|
||||||
|
<ImageBrush ImageSource="{DynamicResource nav_appbar_star}"
|
||||||
|
Stretch="Fill" />
|
||||||
|
</Rectangle.OpacityMask>
|
||||||
|
</Rectangle>
|
||||||
|
</Grid>
|
||||||
<Image Source="Resources/StateOverlays/OverlayNewContentButton.png"
|
<Image Source="Resources/StateOverlays/OverlayNewContentButton.png"
|
||||||
Visibility="Collapsed"
|
Visibility="Collapsed"
|
||||||
Panel.ZIndex="18"
|
Panel.ZIndex="18"
|
||||||
@@ -753,6 +813,7 @@
|
|||||||
<Border Visibility="Hidden"
|
<Border Visibility="Hidden"
|
||||||
Tag="ActiveIndicator"
|
Tag="ActiveIndicator"
|
||||||
Panel.ZIndex="1001"
|
Panel.ZIndex="1001"
|
||||||
|
Opacity="0"
|
||||||
Width="4"
|
Width="4"
|
||||||
Height="34"
|
Height="34"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
@@ -767,6 +828,9 @@
|
|||||||
</Button.Template>
|
</Button.Template>
|
||||||
<StackPanel Orientation="Horizontal"
|
<StackPanel Orientation="Horizontal"
|
||||||
Background="Transparent">
|
Background="Transparent">
|
||||||
|
<Grid Width="34"
|
||||||
|
Height="34"
|
||||||
|
Margin="14">
|
||||||
<Image Source="{DynamicResource nav_appbar_information}"
|
<Image Source="{DynamicResource nav_appbar_information}"
|
||||||
x:Name="icoInfo"
|
x:Name="icoInfo"
|
||||||
Tag="ICO"
|
Tag="ICO"
|
||||||
@@ -774,8 +838,19 @@
|
|||||||
Panel.ZIndex="18"
|
Panel.ZIndex="18"
|
||||||
Style="{StaticResource ImageStyle}"
|
Style="{StaticResource ImageStyle}"
|
||||||
Width="34"
|
Width="34"
|
||||||
|
Height="34" />
|
||||||
|
<Rectangle Tag="ActiveIcon"
|
||||||
|
Visibility="Hidden"
|
||||||
|
Panel.ZIndex="19"
|
||||||
|
Width="34"
|
||||||
Height="34"
|
Height="34"
|
||||||
Margin="14" />
|
Fill="{DynamicResource accentColor}">
|
||||||
|
<Rectangle.OpacityMask>
|
||||||
|
<ImageBrush ImageSource="{DynamicResource nav_appbar_information}"
|
||||||
|
Stretch="Fill" />
|
||||||
|
</Rectangle.OpacityMask>
|
||||||
|
</Rectangle>
|
||||||
|
</Grid>
|
||||||
<Image Source="Resources/StateOverlays/OverlayNewContentButton.png"
|
<Image Source="Resources/StateOverlays/OverlayNewContentButton.png"
|
||||||
Visibility="Collapsed"
|
Visibility="Collapsed"
|
||||||
Panel.ZIndex="18"
|
Panel.ZIndex="18"
|
||||||
|
|||||||
@@ -907,6 +907,13 @@ namespace C4IT_CustomerPanel
|
|||||||
: visualHelper.FindVisualChild<FrameworkElement>(button, "ActiveIndicator");
|
: visualHelper.FindVisualChild<FrameworkElement>(button, "ActiveIndicator");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private FrameworkElement GetActiveTabIcon(Button button)
|
||||||
|
{
|
||||||
|
return button == null
|
||||||
|
? null
|
||||||
|
: visualHelper.FindVisualChild<FrameworkElement>(button, "ActiveIcon");
|
||||||
|
}
|
||||||
|
|
||||||
public void SetMenuAktivInaktiv(object sender, bool force, bool Silent = false)
|
public void SetMenuAktivInaktiv(object sender, bool force, bool Silent = false)
|
||||||
{
|
{
|
||||||
Button clickedButton = (Button)sender;
|
Button clickedButton = (Button)sender;
|
||||||
@@ -914,22 +921,23 @@ namespace C4IT_CustomerPanel
|
|||||||
|
|
||||||
if (ActiveButton != clickedButton)
|
if (ActiveButton != clickedButton)
|
||||||
{
|
{
|
||||||
SolidColorBrush btnColor1 = this.ConfigSettings.GetActiveButtonColor();
|
clickedButton.Background = Brushes.Transparent;
|
||||||
if (btnColor1 != null)
|
|
||||||
{
|
|
||||||
clickedButton.Background = btnColor1;
|
|
||||||
|
|
||||||
FrameworkElement activeIndicator = GetActiveTabIndicator(clickedButton);
|
FrameworkElement activeIndicator = GetActiveTabIndicator(clickedButton);
|
||||||
if (activeIndicator != null)
|
if (activeIndicator != null)
|
||||||
activeIndicator.Visibility = Visibility.Visible;
|
activeIndicator.Visibility = Visibility.Visible;
|
||||||
}
|
FrameworkElement activeIcon = GetActiveTabIcon(clickedButton);
|
||||||
SolidColorBrush btnColor2 = this.ConfigSettings.GetInactiveButtonColor();
|
if (activeIcon != null)
|
||||||
if (btnColor2 != null && ActiveButton != null)
|
activeIcon.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
|
if (ActiveButton != null)
|
||||||
{
|
{
|
||||||
ActiveButton.Background = btnColor2;
|
ActiveButton.Background = Brushes.Transparent;
|
||||||
FrameworkElement inactiveIndicator = GetActiveTabIndicator(ActiveButton);
|
FrameworkElement inactiveIndicator = GetActiveTabIndicator(ActiveButton);
|
||||||
if (inactiveIndicator != null)
|
if (inactiveIndicator != null)
|
||||||
inactiveIndicator.Visibility = Visibility.Hidden;
|
inactiveIndicator.Visibility = Visibility.Hidden;
|
||||||
|
FrameworkElement inactiveIcon = GetActiveTabIcon(ActiveButton);
|
||||||
|
if (inactiveIcon != null)
|
||||||
|
inactiveIcon.Visibility = Visibility.Hidden;
|
||||||
}
|
}
|
||||||
ActiveButton = clickedButton;
|
ActiveButton = clickedButton;
|
||||||
}
|
}
|
||||||
@@ -1716,15 +1724,7 @@ namespace C4IT_CustomerPanel
|
|||||||
if (!(sender is Button bu))
|
if (!(sender is Button bu))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SolidColorBrush Col;
|
bu.Background = Brushes.Transparent;
|
||||||
if (!Equals(ActiveButton, bu))
|
|
||||||
Col = ConfigSettings.GetInactiveButtonColor();
|
|
||||||
else
|
|
||||||
Col = ConfigSettings.GetActiveButtonColor();
|
|
||||||
|
|
||||||
var convertFromString = Col;
|
|
||||||
if (convertFromString != null)
|
|
||||||
bu.Background = Col;
|
|
||||||
}
|
}
|
||||||
catch (Exception exp)
|
catch (Exception exp)
|
||||||
{
|
{
|
||||||
@@ -1782,6 +1782,9 @@ namespace C4IT_CustomerPanel
|
|||||||
FrameworkElement activeIndicator = GetActiveTabIndicator(bu);
|
FrameworkElement activeIndicator = GetActiveTabIndicator(bu);
|
||||||
if (activeIndicator != null)
|
if (activeIndicator != null)
|
||||||
activeIndicator.Visibility = Visibility.Visible;
|
activeIndicator.Visibility = Visibility.Visible;
|
||||||
|
FrameworkElement activeIcon = GetActiveTabIcon(bu);
|
||||||
|
if (activeIcon != null)
|
||||||
|
activeIcon.Visibility = Visibility.Visible;
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user