diff --git a/MatterControlLib/ApplicationView/Themes/ThemeConfig.cs b/MatterControlLib/ApplicationView/Themes/ThemeConfig.cs index 42a202eff..ad06655c2 100644 --- a/MatterControlLib/ApplicationView/Themes/ThemeConfig.cs +++ b/MatterControlLib/ApplicationView/Themes/ThemeConfig.cs @@ -524,9 +524,15 @@ namespace MatterHackers.MatterControl return solidSlider; } + // ApplySquareBoxStyle public SectionWidget ApplyBoxStyle(SectionWidget sectionWidget, BorderDouble margin) { - return ApplyBoxStyle(sectionWidget, this.SectionBackgroundColor, margin); + sectionWidget.BackgroundColor = this.SectionBackgroundColor; + sectionWidget.Margin = 0; + sectionWidget.Border = new BorderDouble(bottom: 1); + sectionWidget.BorderColor = this.RowBorder; + + return sectionWidget; } public SectionWidget ApplyBoxStyle(SectionWidget sectionWidget, Color backgroundColor, BorderDouble margin) diff --git a/MatterControlLib/DesignTools/PublicPropertyEditor.cs b/MatterControlLib/DesignTools/PublicPropertyEditor.cs index ffc412e7c..8c68e308a 100644 --- a/MatterControlLib/DesignTools/PublicPropertyEditor.cs +++ b/MatterControlLib/DesignTools/PublicPropertyEditor.cs @@ -206,24 +206,15 @@ namespace MatterHackers.MatterControl.DesignTools public static GuiWidget CreateSettingsRow(string labelText, string toolTipText, GuiWidget guiWidget, ThemeConfig theme) { - var rowContainer = new FlowLayoutWidget(FlowDirection.LeftToRight) + guiWidget.VAnchor |= VAnchor.Center; + + var row = new SettingsRow(labelText, toolTipText, theme) { - HAnchor = HAnchor.Stretch, - Padding = new BorderDouble(5), - ToolTipText = toolTipText + Padding = new BorderDouble(right: theme.DefaultContainerPadding) }; + row.AddChild(guiWidget); - rowContainer.AddChild(new TextWidget(labelText + ":", pointSize: 11, textColor: theme.TextColor) - { - Margin = new BorderDouble(0, 0, 3, 0), - VAnchor = VAnchor.Center, - }); - - rowContainer.AddChild(new HorizontalSpacer()); - - rowContainer.AddChild(guiWidget); - - return rowContainer; + return row; } private static FlowLayoutWidget CreateSettingsColumn(EditableProperty property, UIField field) diff --git a/MatterControlLib/PartPreviewWindow/SelectedObjectPanel.cs b/MatterControlLib/PartPreviewWindow/SelectedObjectPanel.cs index 73bc4e46c..480e1e140 100644 --- a/MatterControlLib/PartPreviewWindow/SelectedObjectPanel.cs +++ b/MatterControlLib/PartPreviewWindow/SelectedObjectPanel.cs @@ -144,7 +144,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow HAnchor = HAnchor.Stretch, VAnchor = VAnchor.Fit, Name = "editorPanel", - Padding = new BorderDouble(right: theme.DefaultContainerPadding + 1) }; // Wrap editorPanel with scrollable container @@ -163,7 +162,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow this.AddChild(editorSectionWidget); this.ContentPanel = editorPanel; - editorPanel.Padding = new BorderDouble(theme.DefaultContainerPadding, 0); // Register listeners scene.SelectionChanged += Scene_SelectionChanged; @@ -261,6 +259,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow // color row var row = PublicPropertyEditor.CreateSettingsRow("Color".Localize(), null, colorField.Content, theme); + + // Special top border style for first item in editor + row.Border = new BorderDouble(0, 1); + editorPanel.AddChild(row); // put in a material edit field @@ -337,7 +339,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow // Enforce panel padding foreach (var sectionWidget in editorPanel.Descendants()) { - sectionWidget.Margin = new BorderDouble(0, theme.DefaultContainerPadding / 2); + sectionWidget.Margin = 0; } } else