diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch')
3 files changed, 49 insertions, 6 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs index 3a0d3de9e..5fb4496e0 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs @@ -24,7 +24,18 @@ namespace Tango.Touch.Controls private const string PART_Rectangle = "PART_Rectangle"; private Line _line; private Object _lastSelectedItem; + + public int LineThickness + { + get { return (int)GetValue(LineThicknessProperty); } + set { SetValue(LineThicknessProperty, value); } + } + + // Using a DependencyProperty as the backing store for LineThickness. This enables animation, styling, binding, etc... + public static readonly DependencyProperty LineThicknessProperty = + DependencyProperty.Register("LineThickness", typeof(int), typeof(TouchNavigationLinks), new PropertyMetadata(3)); + static TouchNavigationLinks() { DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchNavigationLinks), new FrameworkPropertyMetadata(typeof(TouchNavigationLinks))); @@ -48,12 +59,14 @@ namespace Tango.Touch.Controls private void MoveLineToSelectedItem() { - if (SelectedItem != null) + if (SelectedItem != null ) { + if(SelectedItem is UIElement && ((UIElement)SelectedItem).IsEnabled == false) + return; var container = ItemContainerGenerator.ContainerFromItem(SelectedItem) as FrameworkElement; - + ContentPresenter presenter = container.FindChild<ContentPresenter>().FindChild<ContentPresenter>(); - + if (presenter != null) { Point relativePoint = presenter.TransformToAncestor(this).Transform(new Point(0, 0)); @@ -87,8 +100,9 @@ namespace Tango.Touch.Controls _line.BeginAnimation(Line.X2Property, aniX2); } } + _lastSelectedItem = SelectedItem; } - + _lastSelectedItem = SelectedItem; } } diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml index 599dfdf7c..2b8b4ff03 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml @@ -37,10 +37,11 @@ <Setter Property="BorderThickness" Value="1"/> <Setter Property="MinHeight" Value="40"></Setter> <Setter Property="FocusVisualStyle" Value="{x:Null}"/> + <Setter Property="IsEnabled" Value="true"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ListBoxItem}"> - <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true"> + <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true" IsEnabled="{TemplateBinding IsEnabled}"> <components:Ripple CornerRadius="5" RippleBrush="{StaticResource TangoRippleDarkBrush}"> <StackPanel Orientation="Horizontal"> <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> @@ -77,7 +78,7 @@ <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true"> <StackPanel> <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Stretch"/> - <Line x:Name="PART_Rectangle" X1="0" X2="0" Y1="0" Y2="0" Margin="0 5 0 -3" Stroke="{StaticResource TangoPrimaryAccentBrush}" StrokeThickness="3" HorizontalAlignment="Stretch"></Line> + <Line x:Name="PART_Rectangle" X1="0" X2="0" Y1="0" Y2="0" Margin="0 5 0 -3" Stroke="{StaticResource TangoPrimaryAccentBrush}" StrokeThickness="{Binding RelativeSource={RelativeSource AncestorType=local:TouchNavigationLinks},Path=LineThickness}" HorizontalAlignment="Stretch"></Line> </StackPanel> </Border> </ControlTemplate> diff --git a/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml b/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml index 283e69b45..1dc2090aa 100644 --- a/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml +++ b/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml @@ -60,6 +60,17 @@ <Color x:Key="TangoPanelMaskColorLight">#55FFFFFF</Color> <Color x:Key="TangoMenuPanelDarkColor">#000131</Color> + <Color x:Key="Tango_RealTimeGraph_White">#18FFFFFF</Color> + <Color x:Key="Tango_RealTimeGraph_Red">#B6FF6F6F</Color> + <Color x:Key="Tango_RealTimeGraph_Yellow">#BBFFB84B</Color> + <Color x:Key="Tango_RealTimeGraph_Green">#B958C13B</Color> + <Color x:Key="Tango_RealTimeGraph_Orange">#BBFA9252</Color> + + <Color x:Key="Tango_RealTimeGraph_ForegroundColor">#7C98B3</Color> + <Color x:Key="Tango_RealTimeGraph_OuterBorderColor">#202020</Color> + <Color x:Key="Tango_RealTimeGraph_InnerBorderColor">#505050</Color> + <Color x:Key="Tango_RealTimeGraph_GridLinesColor">#303030</Color> + <!--Brushes--> <SolidColorBrush x:Key="TangoPrimaryBackgroundBrush" Color="{StaticResource TangoPrimaryBackgroundColor}"></SolidColorBrush> <SolidColorBrush x:Key="TangoMidBackgroundBrush" Color="{StaticResource TangoMidBackgroundColor}"></SolidColorBrush> @@ -128,4 +139,21 @@ <SolidColorBrush x:Key="TangoPowerMenuOpenedBackgroundBrush" Color="{StaticResource TangoPowerMenuOpenedBackgroundColor}"></SolidColorBrush> <SolidColorBrush x:Key="TangoMenuPanelDarkBrush" Color="{StaticResource TangoMenuPanelDarkColor}"></SolidColorBrush> + + <SolidColorBrush x:Key="Tango_RealTimeGraph_ForegroundBrush" Color="{StaticResource Tango_RealTimeGraph_ForegroundColor}" /> + <SolidColorBrush x:Key="Tango_RealTimeGraph_OuterBorderBrush" Color="{StaticResource Tango_RealTimeGraph_OuterBorderColor}" /> + <SolidColorBrush x:Key="Tango_RealTimeGraph_InnerBorderBrush" Color="{StaticResource Tango_RealTimeGraph_InnerBorderColor}" /> + <SolidColorBrush x:Key="Tango_RealTimeGraph_GridLinesBrush" Color="{StaticResource Tango_RealTimeGraph_GridLinesColor}" /> + + <LinearGradientBrush x:Key="Tango_RealTimeGraph_BackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0" > + <GradientStop Color="#202020"/> + <GradientStop Color="#FF333333" Offset="1"/> + </LinearGradientBrush> + + <SolidColorBrush x:Key="Tango_RealTimeGraph_WhiteBrush" Color="{StaticResource Tango_RealTimeGraph_White}"></SolidColorBrush> + <SolidColorBrush x:Key="Tango_RealTimeGraph_RedBrush" Color="{StaticResource Tango_RealTimeGraph_Red}"></SolidColorBrush> + <SolidColorBrush x:Key="Tango_RealTimeGraph_YellowBrush" Color="{StaticResource Tango_RealTimeGraph_Yellow}"></SolidColorBrush> + <SolidColorBrush x:Key="Tango_RealTimeGraph_GreenBrush" Color="{StaticResource Tango_RealTimeGraph_Green}"></SolidColorBrush> + <SolidColorBrush x:Key="Tango_RealTimeGraph_OrangeBrush" Color="{StaticResource Tango_RealTimeGraph_Orange}"></SolidColorBrush> + </ResourceDictionary>
\ No newline at end of file |
