Use ToggleButton for variable options chevron button (#1219)
* Use togglebutton instead * Update src/Calculator/Views/GraphingCalculator/EquationInputArea.xaml Co-authored-by: Rudy Huyn <rudyhuyn@gmail.com> * Update src/Calculator/Views/GraphingCalculator/EquationInputArea.xaml Co-authored-by: Rudy Huyn <rudyhuyn@gmail.com> * undo pr suggestion Co-authored-by: Rudy Huyn <rudyhuyn@gmail.com>
This commit is contained in:
parent
7a6b0a72c3
commit
0f14e4f46e
@ -4433,7 +4433,11 @@
|
|||||||
</data>
|
</data>
|
||||||
<data name="VariableAreaSettings.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
<data name="VariableAreaSettings.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
|
||||||
<value>Variable options</value>
|
<value>Variable options</value>
|
||||||
<comment>Screen reader prompt for the variable settings button</comment>
|
<comment>Screen reader prompt for the variable settings toggle button</comment>
|
||||||
|
</data>
|
||||||
|
<data name="VariableAreaSettings.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
|
||||||
|
<value>Toggle variable options</value>
|
||||||
|
<comment>Tool tip for the variable settings toggle button</comment>
|
||||||
</data>
|
</data>
|
||||||
<data name="LineThicknessBoxHeading.Text" xml:space="preserve">
|
<data name="LineThicknessBoxHeading.Text" xml:space="preserve">
|
||||||
<value>Line Thickness</value>
|
<value>Line Thickness</value>
|
||||||
|
@ -215,17 +215,50 @@
|
|||||||
Text="{x:Bind Max, Mode=OneWay}"/>
|
Text="{x:Bind Max, Mode=OneWay}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Button x:Uid="VariableAreaSettings"
|
|
||||||
Margin="0,6,0,0"
|
<ToggleButton Name="VariableAreaSettings"
|
||||||
HorizontalAlignment="Center"
|
x:Uid="VariableAreaSettings"
|
||||||
VerticalAlignment="Center"
|
Margin="0,6,0,0"
|
||||||
Background="Transparent"
|
HorizontalAlignment="Center"
|
||||||
Click="VariableAreaClicked"
|
VerticalAlignment="Center"
|
||||||
Tapped="VariableAreaButtonTapped">
|
Click="VariableAreaClicked"
|
||||||
|
IsChecked="{x:Bind SliderSettingsVisible, Mode=OneWay}"
|
||||||
|
Tapped="VariableAreaButtonTapped">
|
||||||
|
<ToggleButton.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.ThemeDictionaries>
|
||||||
|
<ResourceDictionary x:Key="Default">
|
||||||
|
<SolidColorBrush x:Key="ToggleButtonBackground" Color="Transparent"/>
|
||||||
|
<SolidColorBrush x:Key="ToggleButtonBackgroundChecked" Color="Transparent"/>
|
||||||
|
<StaticResource x:Key="ToggleButtonBorderBrushChecked" ResourceKey="ToggleButtonBorderBrush"/>
|
||||||
|
<StaticResource x:Key="ToggleButtonForegroundChecked" ResourceKey="ToggleButtonForeground"/>
|
||||||
|
<StaticResource x:Key="ToggleButtonBackgroundCheckedPointerOver" ResourceKey="ToggleButtonBackgroundPointerOver"/>
|
||||||
|
<StaticResource x:Key="ToggleButtonBorderBrushCheckedPointerOver" ResourceKey="ToggleButtonBorderBrushPointerOver"/>
|
||||||
|
<StaticResource x:Key="ToggleButtonForegroundCheckedPointerOver" ResourceKey="ToggleButtonForegroundPointerOver"/>
|
||||||
|
<StaticResource x:Key="ToggleButtonBackgroundCheckedPressed" ResourceKey="ToggleButtonBackgroundPressed"/>
|
||||||
|
<StaticResource x:Key="ToggleButtonBorderBrushCheckedPressed" ResourceKey="ToggleButtonBorderBrushPressed"/>
|
||||||
|
<StaticResource x:Key="ToggleButtonForegroundCheckedPressed" ResourceKey="ToggleButtonForegroundPressed"/>
|
||||||
|
</ResourceDictionary>
|
||||||
|
<ResourceDictionary x:Key="Light">
|
||||||
|
<SolidColorBrush x:Key="ToggleButtonBackground" Color="Transparent"/>
|
||||||
|
<SolidColorBrush x:Key="ToggleButtonBackgroundChecked" Color="Transparent"/>
|
||||||
|
<StaticResource x:Key="ToggleButtonBorderBrushChecked" ResourceKey="ToggleButtonBorderBrush"/>
|
||||||
|
<StaticResource x:Key="ToggleButtonForegroundChecked" ResourceKey="ToggleButtonForeground"/>
|
||||||
|
<StaticResource x:Key="ToggleButtonBackgroundCheckedPointerOver" ResourceKey="ToggleButtonBackgroundPointerOver"/>
|
||||||
|
<StaticResource x:Key="ToggleButtonBorderBrushCheckedPointerOver" ResourceKey="ToggleButtonBorderBrushPointerOver"/>
|
||||||
|
<StaticResource x:Key="ToggleButtonForegroundCheckedPointerOver" ResourceKey="ToggleButtonForegroundPointerOver"/>
|
||||||
|
<StaticResource x:Key="ToggleButtonBackgroundCheckedPressed" ResourceKey="ToggleButtonBackgroundPressed"/>
|
||||||
|
<StaticResource x:Key="ToggleButtonBorderBrushCheckedPressed" ResourceKey="ToggleButtonBorderBrushPressed"/>
|
||||||
|
<StaticResource x:Key="ToggleButtonForegroundCheckedPressed" ResourceKey="ToggleButtonForegroundPressed"/>
|
||||||
|
</ResourceDictionary>
|
||||||
|
<ResourceDictionary x:Key="HighContrast"/>
|
||||||
|
</ResourceDictionary.ThemeDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ToggleButton.Resources>
|
||||||
<FontIcon FontFamily="{StaticResource CalculatorFontFamily}"
|
<FontIcon FontFamily="{StaticResource CalculatorFontFamily}"
|
||||||
FontSize="9"
|
FontSize="9"
|
||||||
Glyph="{x:Bind local:EquationInputArea.GetChevronIcon(SliderSettingsVisible), Mode=OneWay}"/>
|
Glyph="{x:Bind local:EquationInputArea.GetChevronIcon(SliderSettingsVisible), Mode=OneWay}"/>
|
||||||
</Button>
|
</ToggleButton>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
@ -484,7 +484,7 @@ void EquationInputArea::EquationTextBox_EquationFormatRequested(Object ^ sender,
|
|||||||
|
|
||||||
void EquationInputArea::VariableAreaClicked(Object ^ sender, RoutedEventArgs ^ e)
|
void EquationInputArea::VariableAreaClicked(Object ^ sender, RoutedEventArgs ^ e)
|
||||||
{
|
{
|
||||||
ToggleVariableArea(static_cast<VariableViewModel ^>(static_cast<Button ^>(sender)->DataContext));
|
ToggleVariableArea(static_cast<VariableViewModel ^>(static_cast<ToggleButton ^>(sender)->DataContext));
|
||||||
}
|
}
|
||||||
|
|
||||||
void EquationInputArea::ToggleVariableArea(VariableViewModel ^ selectedVariableViewModel)
|
void EquationInputArea::ToggleVariableArea(VariableViewModel ^ selectedVariableViewModel)
|
||||||
|
Loading…
Reference in New Issue
Block a user