De-emphasize toggle switch borders

This commit is contained in:
John Lewin 2017-10-01 19:49:31 -07:00
parent ad71573983
commit 7590d71fc3
3 changed files with 8 additions and 7 deletions

View file

@ -75,7 +75,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage
return null;
}
var toggleSwitch = ImageButtonFactory.CreateToggleSwitch(toggleSwitchConfig.Checked, menuTextColor);
var toggleSwitch = ImageButtonFactory.CreateToggleSwitch(toggleSwitchConfig.Checked, menuTextColor, backgroundType: IconColor.White);
toggleSwitch.VAnchor = VAnchor.Center;
toggleSwitch.Margin = new BorderDouble(left: 16);
toggleSwitch.CheckedStateChanged += (sender, e) =>

View file

@ -46,12 +46,12 @@ namespace MatterHackers.MatterControl
return CreateToggleSwitch(initialState, ActiveTheme.Instance.PrimaryTextColor);
}
public static CheckBox CreateToggleSwitch(bool initialState, RGBA_Bytes textColor, bool useStandardLabels = true)
public static CheckBox CreateToggleSwitch(bool initialState, RGBA_Bytes textColor, bool useStandardLabels = true, IconColor backgroundType = IconColor.Theme)
{
return CreateToggleSwitch(initialState, textColor, 60 * GuiWidget.DeviceScale, 24 * GuiWidget.DeviceScale, useStandardLabels);
return CreateToggleSwitch(initialState, textColor, 60 * GuiWidget.DeviceScale, 24 * GuiWidget.DeviceScale, useStandardLabels, backgroundType);
}
public static CheckBox CreateToggleSwitch(bool initialState, RGBA_Bytes textColor, double pixelWidth, double pixelHeight, bool useStandardLabels = true)
public static CheckBox CreateToggleSwitch(bool initialState, RGBA_Bytes textColor, double pixelWidth, double pixelHeight, bool useStandardLabels = true, IconColor backgroundType = IconColor.Theme)
{
string on = "On";
string off = "Off";
@ -76,9 +76,10 @@ namespace MatterHackers.MatterControl
ActiveTheme.Instance.PrimaryBackgroundColor,
new RGBA_Bytes(220, 220, 220),
ActiveTheme.Instance.PrimaryAccentColor,
textColor))
textColor,
(backgroundType == IconColor.White) ? ActiveTheme.Instance.SecondaryTextColor : new RGBA_Bytes(ActiveTheme.Instance.SecondaryTextColor, 120)))
{
Checked = initialState
Checked = initialState,
};
}

@ -1 +1 @@
Subproject commit cd0de157e139e51250b53eaeacbd8ec846694830
Subproject commit a0cfc2aeb30b2dbdbd7abf7cf083ac07c323166c