Update graph tooltip design and content (#867)

* update graph tooltip

* modify font size
This commit is contained in:
Rudy Huyn 2019-12-16 10:41:35 -08:00 committed by Eric Wong
parent eb2fa6db9b
commit fe599e31f8
2 changed files with 24 additions and 9 deletions

View File

@ -231,6 +231,13 @@
<Style x:Key="ThemedGraphToggleButtonStyle" <Style x:Key="ThemedGraphToggleButtonStyle"
BasedOn="{StaticResource GraphToggleButtonStyle}" BasedOn="{StaticResource GraphToggleButtonStyle}"
TargetType="ToggleButton"/> TargetType="ToggleButton"/>
<Style x:Key="GraphTooltipStyle" TargetType="Border">
<Setter Property="BorderBrush" Value="#e0e0e0"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="Background" Value="{ThemeResource SystemControlAcrylicElementBrush}"/>
</Style>
</ResourceDictionary> </ResourceDictionary>
<ResourceDictionary x:Key="Light"> <ResourceDictionary x:Key="Light">
<Style x:Key="ThemedSwitchModeToggleButtonStyle" <Style x:Key="ThemedSwitchModeToggleButtonStyle"
@ -251,6 +258,12 @@
<Style x:Key="ThemedGraphToggleButtonStyle" <Style x:Key="ThemedGraphToggleButtonStyle"
BasedOn="{StaticResource GraphToggleButtonStyle}" BasedOn="{StaticResource GraphToggleButtonStyle}"
TargetType="ToggleButton"/> TargetType="ToggleButton"/>
<Style x:Key="GraphTooltipStyle" TargetType="Border">
<Setter Property="BorderBrush" Value="#e0e0e0"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="Background" Value="{ThemeResource SystemControlAcrylicElementBrush}"/>
</Style>
</ResourceDictionary> </ResourceDictionary>
<ResourceDictionary x:Key="HighContrast"> <ResourceDictionary x:Key="HighContrast">
<Style x:Key="ThemedSwitchModeToggleButtonStyle" TargetType="ToggleButton"/> <Style x:Key="ThemedSwitchModeToggleButtonStyle" TargetType="ToggleButton"/>
@ -264,6 +277,11 @@
<Style x:Key="ThemedGraphToggleButtonStyle" TargetType="ToggleButton"> <Style x:Key="ThemedGraphToggleButtonStyle" TargetType="ToggleButton">
<Setter Property="Margin" Value="1"/> <Setter Property="Margin" Value="1"/>
</Style> </Style>
<Style x:Key="GraphTooltipStyle" TargetType="Border">
<Setter Property="BorderBrush" Value="{ThemeResource ToolTipBorderBrush}"/>
<Setter Property="BorderThickness" Value="{ThemeResource ToolTipBorderThemeThickness}"/>
<Setter Property="Background" Value="{ThemeResource ToolTipBackground}"/>
</Style>
</ResourceDictionary> </ResourceDictionary>
</ResourceDictionary.ThemeDictionaries> </ResourceDictionary.ThemeDictionaries>
</ResourceDictionary> </ResourceDictionary>
@ -447,10 +465,7 @@
Padding="{ThemeResource ToolTipBorderThemePadding}" Padding="{ThemeResource ToolTipBorderThemePadding}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Top" VerticalAlignment="Top"
Background="{ThemeResource ToolTipBackground}" Style="{ThemeResource GraphTooltipStyle}"
BorderBrush="{ThemeResource ToolTipBorderBrush}"
BorderThickness="{ThemeResource ToolTipBorderThemeThickness}"
contract7Present:BackgroundSizing="OuterBorderEdge"
IsHitTestVisible="False" IsHitTestVisible="False"
SizeChanged="TraceValuePopup_SizeChanged" SizeChanged="TraceValuePopup_SizeChanged"
Visibility="Collapsed"> Visibility="Collapsed">
@ -459,8 +474,8 @@
</Border.RenderTransform> </Border.RenderTransform>
<TextBlock x:Name="TraceValue" <TextBlock x:Name="TraceValue"
Foreground="{ThemeResource ToolTipForeground}" Foreground="{ThemeResource ToolTipForeground}"
AutomationProperties.LiveSetting="Polite" FontSize="{ThemeResource ToolTipContentThemeFontSize}"
Text="x=0,y=0"/> AutomationProperties.LiveSetting="Polite"/>
</Border> </Border>
</Grid> </Grid>

View File

@ -152,7 +152,7 @@ void GraphingCalculator::OnTracePointChanged(Windows::Foundation::Point newPoint
wstringstream traceValueString; wstringstream traceValueString;
// TODO: The below precision should ideally be dynamic based on the current scale of the graph. // TODO: The below precision should ideally be dynamic based on the current scale of the graph.
traceValueString << "x=" << fixed << setprecision(1) << newPoint.X << ", y=" << fixed << setprecision(1) << newPoint.Y; traceValueString << "(" << fixed << setprecision(1) << newPoint.X << ", " << fixed << setprecision(1) << newPoint.Y << ")";
TraceValue->Text = ref new String(traceValueString.str().c_str()); TraceValue->Text = ref new String(traceValueString.str().c_str());