Dark Theme For Graph Control (#1106)
* Added dark them to graph control, started dark theme for the controls on the graph * Dark theme for graphing mode updated to use event model, diagnostics added, cleaned up code that wasn't needed * Updated prepare-release-internalonly.yaml internal package version * Updated Theme Settings properties, removed version change, other small changes from PR feedback> * Updated the localSettings check and updated the GraphTheme event to send bool instead of string * Updated the equation line color to change with the graph theme * Rebased onto master and issues created during the rebase * Updates per code review feedback * Update settings properties to just have IsMatchAppTheme property and updated the high contrast settings for the graph control * Match version to current in master * Updated per PR feedback * Fix resetting the m_lastLineColorIndex to only happen when reassignColors is true * Changed second if to else if in the OnPropertyChanged method * fixed control button and equation line colors
This commit is contained in:
@@ -16,6 +16,7 @@ using namespace Concurrency;
|
||||
using namespace Windows::Devices::Input;
|
||||
using namespace Windows::Foundation;
|
||||
using namespace Windows::Foundation::Collections;
|
||||
using namespace Windows::Storage;
|
||||
using namespace Windows::Storage::Streams;
|
||||
using namespace Windows::System;
|
||||
using namespace Windows::System::Threading;
|
||||
@@ -34,6 +35,7 @@ DEPENDENCY_PROPERTY_INITIALIZATION(Grapher, Variables);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(Grapher, Equations);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(Grapher, AxesColor);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(Grapher, GraphBackground);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(Grapher, GridLinesColor);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(Grapher, LineWidth);
|
||||
|
||||
namespace
|
||||
@@ -1056,6 +1058,17 @@ void Grapher::OnGraphBackgroundPropertyChanged(Windows::UI::Color /*oldValue*/,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Grapher::OnGridLinesColorPropertyChanged(Windows::UI::Color /*oldValue*/, Windows::UI::Color newValue)
|
||||
{
|
||||
if (m_renderMain != nullptr && m_graph != nullptr)
|
||||
{
|
||||
auto gridLinesColor = Graphing::Color(newValue.R, newValue.G, newValue.B, newValue.A);
|
||||
m_graph->GetOptions().SetGridColor(gridLinesColor);
|
||||
m_renderMain->RunRenderPassAsync();
|
||||
}
|
||||
}
|
||||
|
||||
void Grapher::OnLineWidthPropertyChanged(double oldValue, double newValue)
|
||||
{
|
||||
if (m_graph)
|
||||
|
@@ -50,6 +50,8 @@ public
|
||||
DEPENDENCY_PROPERTY_R_WITH_DEFAULT_AND_CALLBACK(GraphControl::EquationCollection ^, Equations, nullptr);
|
||||
DEPENDENCY_PROPERTY_WITH_DEFAULT_AND_CALLBACK(Windows::UI::Color, AxesColor, Windows::UI::Colors::Transparent);
|
||||
DEPENDENCY_PROPERTY_WITH_DEFAULT_AND_CALLBACK(Windows::UI::Color, GraphBackground, Windows::UI::Colors::Transparent);
|
||||
DEPENDENCY_PROPERTY_WITH_DEFAULT_AND_CALLBACK(Windows::UI::Color, GridLinesColor, Windows::UI::Colors::Transparent);
|
||||
|
||||
DEPENDENCY_PROPERTY_WITH_DEFAULT_AND_CALLBACK(double, LineWidth, 2.0);
|
||||
// Pass active tracing turned on or off down to the renderer
|
||||
property bool ActiveTracing
|
||||
@@ -276,6 +278,7 @@ public
|
||||
void OnEquationsPropertyChanged(EquationCollection ^ oldValue, EquationCollection ^ newValue);
|
||||
void OnAxesColorPropertyChanged(Windows::UI::Color oldValue, Windows::UI::Color newValue);
|
||||
void OnGraphBackgroundPropertyChanged(Windows::UI::Color oldValue, Windows::UI::Color newValue);
|
||||
void OnGridLinesColorPropertyChanged(Windows::UI::Color /*oldValue*/, Windows::UI::Color newValue);
|
||||
void OnLineWidthPropertyChanged(double oldValue, double newValue);
|
||||
void OnEquationChanged(Equation ^ equation);
|
||||
void OnEquationStyleChanged(Equation ^ equation);
|
||||
|
Reference in New Issue
Block a user