From 1fe8f0dfe2e0446aee852994e8258be072a0fea9 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Fri, 17 Nov 2017 17:07:04 -0800 Subject: [PATCH] Remove vertical lines, use border, right align override color border --- SlicerConfiguration/SliceSettingsRow.cs | 21 +++++---------------- SlicerConfiguration/SliceSettingsWidget.cs | 21 +++++++-------------- 2 files changed, 12 insertions(+), 30 deletions(-) diff --git a/SlicerConfiguration/SliceSettingsRow.cs b/SlicerConfiguration/SliceSettingsRow.cs index d1be31c50..0bdac9b12 100644 --- a/SlicerConfiguration/SliceSettingsRow.cs +++ b/SlicerConfiguration/SliceSettingsRow.cs @@ -32,7 +32,6 @@ using System.Linq; using MatterHackers.Agg; using MatterHackers.Agg.UI; using MatterHackers.Localizations; -using MatterHackers.MatterControl.CustomWidgets; using MatterHackers.VectorMath; namespace MatterHackers.MatterControl.SlicerConfiguration @@ -53,7 +52,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration private GuiWidget unitsArea; private GuiWidget restoreArea; private Button restoreButton = null; - private VerticalLine vline; private const bool debugLayout = false; @@ -62,17 +60,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration this.printer = printer; this.settingData = settingData; this.settingsContext = settingsContext; - - vline = new VerticalLine() - { - BackgroundColor = Color.Transparent, - Margin = new BorderDouble(right: 6), - Width = 3, - VAnchor = VAnchor.Stretch, - MinimumSize = new Vector2(0, 28), - DebugShowBounds = debugLayout - }; - this.AddChild(vline); + this.Border = new BorderDouble(right: 4 /*, left: 1 */); + this.MinimumSize = new Vector2(0, 28); this.NameArea = new GuiWidget() { @@ -143,12 +132,12 @@ namespace MatterHackers.MatterControl.SlicerConfiguration public Color HighlightColor { - get => vline.BackgroundColor; + get => this.BorderColor; set { - if (vline.BackgroundColor != value) + if (this.BorderColor != value) { - vline.BackgroundColor = value; + this.BorderColor = value; this.BackgroundColor = (value == Color.Transparent) ? Color.Transparent : ApplicationController.Instance.Theme.MinimalShade; this.StyleChanged?.Invoke(null, null); diff --git a/SlicerConfiguration/SliceSettingsWidget.cs b/SlicerConfiguration/SliceSettingsWidget.cs index 49f7f5b63..8f8cbe4f6 100644 --- a/SlicerConfiguration/SliceSettingsWidget.cs +++ b/SlicerConfiguration/SliceSettingsWidget.cs @@ -498,8 +498,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration var settingsRow = new SliceSettingsRow(printer, settingsContext, settingData) { - Margin = new BorderDouble(0, 0), - Padding = new BorderDouble(0, 0, 10, 0), + Margin = new BorderDouble(right: 4), + Padding = new BorderDouble(12, 0, 10, 0), HAnchor = HAnchor.Stretch, VAnchor = VAnchor.Fit }; @@ -692,20 +692,13 @@ namespace MatterHackers.MatterControl.SlicerConfiguration Name = "row", VAnchor = VAnchor.Fit, HAnchor = HAnchor.Stretch, - BackgroundColor = settingsRow.BackgroundColor + BackgroundColor = settingsRow.BackgroundColor, + Border = new BorderDouble(left: 4), + Padding = new BorderDouble(left: 6, bottom: 2), + MinimumSize = new Vector2(0, 28) }; column.AddChild(row); - var vline = new VerticalLine() - { - BackgroundColor = settingsRow.HighlightColor, - Margin = new BorderDouble(right: 6, bottom: 2), - Width = 3, - VAnchor = VAnchor.Stretch, - MinimumSize = new Vector2(0, 28), - }; - row.AddChild(vline); - var contentWrapper = new GuiWidget { Name = "contentWrapper", @@ -720,7 +713,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration settingsRow.StyleChanged += (s, e) => { row.BackgroundColor = settingsRow.BackgroundColor; - vline.BackgroundColor = settingsRow.HighlightColor; + row.BorderColor = settingsRow.HighlightColor; }; return column;