Update Icons Implement the Graph View Button (#1149)

* Update icon file

* function analysis and negate button icons updated

* Replace zoom reset button with graph view button

* Fixed issue where the window settings did not update after panning/zooming

* Updated icon styling and added logic for updating the graph view button state when user manipulates the graph and when all equations are removed

* updated LogGraphButton clicked to have an enum for the button value instead of a string

* Updated the logic for how to set the IsManualAdjustment, ensured graphsettings now update IsManualAdjustment when changed
This commit is contained in:
Stephanie Anderl 2020-04-14 12:37:23 -07:00 committed by GitHub
parent 7612b69949
commit 3a8fcaa18a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 220 additions and 60 deletions

View file

@ -26,6 +26,7 @@ namespace CalculatorApp::Common::Automation
StringReference GraphModeChanged(L"GraphModeChanged");
StringReference GraphViewChanged(L"GraphViewChanged");
StringReference FunctionRemoved(L"FunctionRemoved");
StringReference GraphViewBestFitChanged(L"GraphViewBestFitChanged");
}
}
@ -170,3 +171,12 @@ NarratorAnnouncement ^ CalculatorAnnouncement::GetFunctionRemovedAnnouncement(St
AutomationNotificationKind::ItemRemoved,
AutomationNotificationProcessing::MostRecent);
}
NarratorAnnouncement ^ CalculatorAnnouncement::GetGraphViewBestFitChangedAnnouncement(Platform::String ^ announcement)
{
return ref new NarratorAnnouncement(
announcement,
CalculatorActivityIds::GraphViewBestFitChanged,
AutomationNotificationKind::ActionCompleted,
AutomationNotificationProcessing::MostRecent);
}

View file

@ -69,6 +69,7 @@ public
static NarratorAnnouncement ^ GetGraphModeChangedAnnouncement(Platform::String ^ announcement);
static NarratorAnnouncement ^ GetGraphViewChangedAnnouncement(Platform::String ^ announcement);
static NarratorAnnouncement ^ GetGraphViewBestFitChangedAnnouncement(Platform::String ^ announcement);
static NarratorAnnouncement ^ GetFunctionRemovedAnnouncement(Platform::String ^ announcement);

View file

@ -272,11 +272,12 @@ namespace CalculatorApp
TraceLoggingCommon::GetInstance()->LogLevel2Event(StringReference(EVENT_NAME_SHOW_HIDE_BUTTON_CLICKED), fields);
}
void TraceLogger::LogGraphButtonClicked(GraphButton buttonName)
void TraceLogger::LogGraphButtonClicked(GraphButton buttonName, GraphButtonValue buttonValue)
{
auto fields = ref new LoggingFields();
fields->AddString(StringReference(CALC_MODE), StringReference(GRAPHING_MODE));
fields->AddInt16(StringReference(L"ButtonName"), static_cast<int16>(buttonName));
fields->AddInt16(StringReference(L"ButtonValue"), static_cast<int16>(buttonValue));
TraceLoggingCommon::GetInstance()->LogLevel2Event(StringReference(EVENT_NAME_GRAPH_BUTTON_CLICKED), fields);
}

View file

@ -41,7 +41,14 @@ namespace CalculatorApp
Share,
ZoomIn,
ZoomOut,
ZoomReset
GraphView
};
public enum class GraphButtonValue
{
None,
AutomaticBestFit,
ManualAdjustment
};
public enum class LineStyleType
@ -70,7 +77,7 @@ namespace CalculatorApp
void LogNavBarOpened();
void LogError(CalculatorApp::Common::ViewMode mode, Platform::String ^ functionName, Platform::String ^ errorString);
void LogShowHideButtonClicked(bool isHideButton);
void LogGraphButtonClicked(GraphButton buttonName);
void LogGraphButtonClicked(GraphButton buttonName, GraphButtonValue buttonValue);
void LogGraphLineStyleChanged(LineStyleType style);
void LogVariableChanged(Platform::String ^ inputChangedType, Platform::String ^ variableName);
void LogVariableSettingsChanged(Platform::String ^ setting);

View file

@ -56,19 +56,19 @@ void GraphingSettingsViewModel::InitRanges()
m_YMaxValue = yMax;
auto valueStr = to_wstring(m_XMinValue);
TrimTrailingZeros(valueStr);
m_XMin = ref new String(valueStr.c_str());
XMin = ref new String(valueStr.c_str());
valueStr = to_wstring(m_XMaxValue);
TrimTrailingZeros(valueStr);
m_XMax = ref new String(valueStr.c_str());
XMax = ref new String(valueStr.c_str());
valueStr = to_wstring(m_YMinValue);
TrimTrailingZeros(valueStr);
m_YMin = ref new String(valueStr.c_str());
YMin = ref new String(valueStr.c_str());
valueStr = to_wstring(m_YMaxValue);
TrimTrailingZeros(valueStr);
m_YMax = ref new String(valueStr.c_str());
YMax = ref new String(valueStr.c_str());
m_dontUpdateDisplayRange = false;
}