Added a menu item to reset the pen color (to use again the plotColorPalette based color). Moved the saving/loading code to the SensorNode class (as with the other properties).
This commit is contained in:
+22
-2
@@ -4,7 +4,7 @@
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
Copyright (C) 2009-2012 Michael Möller <mmoeller@openhardwaremonitor.org>
|
||||
Copyright (C) 2009-2016 Michael Möller <mmoeller@openhardwaremonitor.org>
|
||||
|
||||
*/
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
private UnitManager unitManager;
|
||||
private string format;
|
||||
private bool plot = false;
|
||||
public Color? penColor = null;
|
||||
private Color? penColor = null;
|
||||
|
||||
public string ValueToString(float? value) {
|
||||
if (value.HasValue) {
|
||||
@@ -61,6 +61,10 @@ namespace OpenHardwareMonitor.GUI {
|
||||
|
||||
this.Plot = settings.GetValue(new Identifier(sensor.Identifier,
|
||||
"plot").ToString(), false);
|
||||
|
||||
string id = new Identifier(sensor.Identifier, "penColor").ToString();
|
||||
if (settings.Contains(id))
|
||||
this.PenColor = settings.GetValue(id, Color.Black);
|
||||
}
|
||||
|
||||
public override string Text {
|
||||
@@ -77,6 +81,22 @@ namespace OpenHardwareMonitor.GUI {
|
||||
}
|
||||
}
|
||||
|
||||
public Color? PenColor {
|
||||
get { return penColor; }
|
||||
set {
|
||||
penColor = value;
|
||||
|
||||
string id = new Identifier(sensor.Identifier, "penColor").ToString();
|
||||
if (value.HasValue)
|
||||
settings.SetValue(id, value.Value);
|
||||
else
|
||||
settings.Remove(id);
|
||||
|
||||
if (PlotSelectionChanged != null)
|
||||
PlotSelectionChanged(this, null);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Plot {
|
||||
get { return plot; }
|
||||
set {
|
||||
|
||||
Reference in New Issue
Block a user