Update equation colors (#885)
This commit is contained in:
@@ -746,10 +746,11 @@
|
||||
Grid.Column="3"
|
||||
MinWidth="28"
|
||||
VerticalAlignment="Stretch"
|
||||
Foreground="{ThemeResource ButtonForeground}"
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="16"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
Glyph=""
|
||||
Glyph=""
|
||||
Visibility="Collapsed"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
@@ -27,6 +27,9 @@ using namespace Calculator::Utils;
|
||||
|
||||
namespace
|
||||
{
|
||||
inline constexpr auto maxEquationSize = 14;
|
||||
inline constexpr std::array<int, 14> colorAssignmentMapping = { 0, 3, 7, 10, 1, 4, 8, 11, 2, 5, 9, 12, 6, 13 };
|
||||
|
||||
StringReference EquationsPropertyName(L"Equations");
|
||||
}
|
||||
|
||||
@@ -67,8 +70,27 @@ void EquationInputArea::AddNewEquation()
|
||||
Equations->GetAt(Equations->Size - 1)->IsLastItemInList = false;
|
||||
}
|
||||
|
||||
// Cap equations at 14
|
||||
if (Equations->Size >= maxEquationSize)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
m_lastLineColorIndex = (m_lastLineColorIndex + 1) % AvailableColors->Size;
|
||||
auto eq = ref new EquationViewModel(ref new Equation(), ++m_lastFunctionLabelIndex, AvailableColors->GetAt(m_lastLineColorIndex)->Color);
|
||||
|
||||
int colorIndex;
|
||||
|
||||
if (m_accessibilitySettings->HighContrast)
|
||||
{
|
||||
colorIndex = m_lastLineColorIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
colorIndex = colorAssignmentMapping[m_lastLineColorIndex];
|
||||
}
|
||||
|
||||
auto eq = ref new EquationViewModel(ref new Equation(), ++m_lastFunctionLabelIndex, AvailableColors->GetAt(colorIndex)->Color);
|
||||
eq->IsLastItemInList = true;
|
||||
m_equationToFocus = eq;
|
||||
Equations->Append(eq);
|
||||
@@ -269,8 +291,6 @@ void EquationInputArea::ReloadAvailableColors(bool isHighContrast)
|
||||
m_AvailableColors->Append(safe_cast<SolidColorBrush ^>(Application::Current->Resources->Lookup(L"EquationBrush12")));
|
||||
m_AvailableColors->Append(safe_cast<SolidColorBrush ^>(Application::Current->Resources->Lookup(L"EquationBrush13")));
|
||||
m_AvailableColors->Append(safe_cast<SolidColorBrush ^>(Application::Current->Resources->Lookup(L"EquationBrush14")));
|
||||
m_AvailableColors->Append(safe_cast<SolidColorBrush ^>(Application::Current->Resources->Lookup(L"EquationBrush15")));
|
||||
m_AvailableColors->Append(safe_cast<SolidColorBrush ^>(Application::Current->Resources->Lookup(L"EquationBrush16")));
|
||||
}
|
||||
|
||||
// If there are no equations to reload, quit early
|
||||
|
@@ -112,17 +112,9 @@
|
||||
|
||||
<Setter Target="OperatorPanelRow.MinHeight" Value="{StaticResource OperatorPanelButtonRowSizeLarge}"/>
|
||||
|
||||
<Setter Target="TrigButton.ChevronFontSize" Value="{ThemeResource OperatorPanelChevronFontSizeLarge}"/>
|
||||
<Setter Target="TrigButton.GlyphFontSize" Value="{ThemeResource OperatorPanelGlyphFontSizeLarge}"/>
|
||||
<Setter Target="TrigButton.FontSize" Value="{ThemeResource OperatorPanelFontSizeLarge}"/>
|
||||
|
||||
<Setter Target="InequalityButton.ChevronFontSize" Value="{ThemeResource OperatorPanelChevronFontSizeLarge}"/>
|
||||
<Setter Target="InequalityButton.GlyphFontSize" Value="{ThemeResource OperatorPanelGlyphFontSizeLarge}"/>
|
||||
<Setter Target="InequalityButton.FontSize" Value="{ThemeResource OperatorPanelFontSizeLarge}"/>
|
||||
|
||||
<Setter Target="FuncButton.ChevronFontSize" Value="{ThemeResource OperatorPanelChevronFontSizeLarge}"/>
|
||||
<Setter Target="FuncButton.GlyphFontSize" Value="{ThemeResource OperatorPanelGlyphFontSizeLarge}"/>
|
||||
<Setter Target="FuncButton.FontSize" Value="{ThemeResource OperatorPanelFontSizeLarge}"/>
|
||||
<Setter Target="TrigButton.Style" Value="{StaticResource OperatorPanelButtonLargeStyle}"/>
|
||||
<Setter Target="InequalityButton.Style" Value="{StaticResource OperatorPanelButtonLargeStyle}"/>
|
||||
<Setter Target="FuncButton.Style" Value="{StaticResource OperatorPanelButtonLargeStyle}"/>
|
||||
|
||||
<Setter Target="TrigGrid.MinWidth" Value="516"/>
|
||||
<Setter Target="TrigGrid.MinHeight" Value="192"/>
|
||||
@@ -225,17 +217,9 @@
|
||||
|
||||
<Setter Target="OperatorPanelRow.MinHeight" Value="{StaticResource OperatorPanelButtonRowSizeMedium}"/>
|
||||
|
||||
<Setter Target="TrigButton.ChevronFontSize" Value="{ThemeResource OperatorPanelChevronFontSizeMedium}"/>
|
||||
<Setter Target="TrigButton.GlyphFontSize" Value="{ThemeResource OperatorPanelGlyphFontSizeMedium}"/>
|
||||
<Setter Target="TrigButton.FontSize" Value="{ThemeResource OperatorPanelFontSizeMedium}"/>
|
||||
|
||||
<Setter Target="InequalityButton.ChevronFontSize" Value="{ThemeResource OperatorPanelChevronFontSizeMedium}"/>
|
||||
<Setter Target="InequalityButton.GlyphFontSize" Value="{ThemeResource OperatorPanelGlyphFontSizeMedium}"/>
|
||||
<Setter Target="InequalityButton.FontSize" Value="{ThemeResource OperatorPanelFontSizeMedium}"/>
|
||||
|
||||
<Setter Target="FuncButton.ChevronFontSize" Value="{ThemeResource OperatorPanelChevronFontSizeMedium}"/>
|
||||
<Setter Target="FuncButton.GlyphFontSize" Value="{ThemeResource OperatorPanelGlyphFontSizeMedium}"/>
|
||||
<Setter Target="FuncButton.FontSize" Value="{ThemeResource OperatorPanelFontSizeMedium}"/>
|
||||
<Setter Target="TrigButton.Style" Value="{StaticResource OperatorPanelButtonMediumStyle}"/>
|
||||
<Setter Target="InequalityButton.Style" Value="{StaticResource OperatorPanelButtonMediumStyle}"/>
|
||||
<Setter Target="FuncButton.Style" Value="{StaticResource OperatorPanelButtonMediumStyle}"/>
|
||||
|
||||
<Setter Target="TrigGrid.MinWidth" Value="480"/>
|
||||
<Setter Target="TrigGrid.MinHeight" Value="144"/>
|
||||
@@ -336,17 +320,9 @@
|
||||
|
||||
<Setter Target="OperatorPanelRow.MinHeight" Value="{ThemeResource OperatorPanelButtonRowSizeSmall}"/>
|
||||
|
||||
<Setter Target="TrigButton.ChevronFontSize" Value="{ThemeResource OperatorPanelChevronFontSizeSmall}"/>
|
||||
<Setter Target="TrigButton.GlyphFontSize" Value="{ThemeResource OperatorPanelGlyphFontSizeSmall}"/>
|
||||
<Setter Target="TrigButton.FontSize" Value="{ThemeResource OperatorPanelFontSizeSmall}"/>
|
||||
|
||||
<Setter Target="InequalityButton.ChevronFontSize" Value="{ThemeResource OperatorPanelChevronFontSizeSmall}"/>
|
||||
<Setter Target="InequalityButton.GlyphFontSize" Value="{ThemeResource OperatorPanelGlyphFontSizeSmall}"/>
|
||||
<Setter Target="InequalityButton.FontSize" Value="{ThemeResource OperatorPanelFontSizeSmall}"/>
|
||||
|
||||
<Setter Target="FuncButton.ChevronFontSize" Value="{ThemeResource OperatorPanelChevronFontSizeSmall}"/>
|
||||
<Setter Target="FuncButton.GlyphFontSize" Value="{ThemeResource OperatorPanelGlyphFontSizeSmall}"/>
|
||||
<Setter Target="FuncButton.FontSize" Value="{ThemeResource OperatorPanelFontSizeSmall}"/>
|
||||
<Setter Target="TrigButton.Style" Value="{StaticResource OperatorPanelButtonSmallStyle}"/>
|
||||
<Setter Target="InequalityButton.Style" Value="{StaticResource OperatorPanelButtonSmallStyle}"/>
|
||||
<Setter Target="FuncButton.Style" Value="{StaticResource OperatorPanelButtonSmallStyle}"/>
|
||||
|
||||
<Setter Target="TrigGrid.MinWidth" Value="258"/>
|
||||
<Setter Target="TrigGrid.MinHeight" Value="96"/>
|
||||
|
@@ -152,7 +152,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid Margin="0,0,1,0" Background="{ThemeResource TextControlBackground}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
|
Reference in New Issue
Block a user