From 7590d71fc3bc8d526a3f86ba30b67216abde2298 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Sun, 1 Oct 2017 19:49:31 -0700 Subject: [PATCH] De-emphasize toggle switch borders --- ConfigurationPage/ApplicationSettings/SettingsItem.cs | 2 +- ControlElements/ImageButtonFactory.cs | 11 ++++++----- Submodules/agg-sharp | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ConfigurationPage/ApplicationSettings/SettingsItem.cs b/ConfigurationPage/ApplicationSettings/SettingsItem.cs index f5923f9d6..53a33e85c 100644 --- a/ConfigurationPage/ApplicationSettings/SettingsItem.cs +++ b/ConfigurationPage/ApplicationSettings/SettingsItem.cs @@ -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) => diff --git a/ControlElements/ImageButtonFactory.cs b/ControlElements/ImageButtonFactory.cs index 22820223e..5dc3ea62b 100644 --- a/ControlElements/ImageButtonFactory.cs +++ b/ControlElements/ImageButtonFactory.cs @@ -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, }; } diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index cd0de157e..a0cfc2aeb 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit cd0de157e139e51250b53eaeacbd8ec846694830 +Subproject commit a0cfc2aeb30b2dbdbd7abf7cf083ac07c323166c