Remove vertical lines, use border, right align override color border

This commit is contained in:
John Lewin 2017-11-17 17:07:04 -08:00
parent 6a2a2ff9cb
commit 1fe8f0dfe2
2 changed files with 12 additions and 30 deletions

View file

@ -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);

View file

@ -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;