mirror of
https://github.com/Microsoft/calculator.git
synced 2025-07-16 02:02:51 -07:00
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:
parent
7612b69949
commit
3a8fcaa18a
15 changed files with 220 additions and 60 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue