From 871c5331c315efce75fe593f50fa00c4de13c3e5 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 8 Jan 2018 17:25:22 -0800 Subject: [PATCH 1/2] Set MinimumSize X to MinDockingWidth - Issue MatterHackers/MCCentral#2612 Must have minimum size on DockingTabs --- CustomWidgets/DockingTabControl.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/CustomWidgets/DockingTabControl.cs b/CustomWidgets/DockingTabControl.cs index 7859b0114..7d3c0c16a 100644 --- a/CustomWidgets/DockingTabControl.cs +++ b/CustomWidgets/DockingTabControl.cs @@ -166,6 +166,7 @@ namespace MatterHackers.MatterControl.CustomWidgets VAnchor = VAnchor.Stretch, SpliterBarColor = theme.SplitterBackground, SplitterWidth = theme.SplitterWidth, + MinimumSize = new Vector2(this.MinDockingWidth, 200) }; tabControl = new SimpleTabs(this.CreatePinButton()) From 70cf16a2f2a84df7e7a556559a8809f277a0ede8 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 8 Jan 2018 17:30:04 -0800 Subject: [PATCH 2/2] Configure Printer should use new tab styling - Issue MatterHackers/MCCentral#2611 --- CustomWidgets/ConfigurePrinterWidget.cs | 43 ++++++++++++++----------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/CustomWidgets/ConfigurePrinterWidget.cs b/CustomWidgets/ConfigurePrinterWidget.cs index 6ced7525c..184bd65e6 100644 --- a/CustomWidgets/ConfigurePrinterWidget.cs +++ b/CustomWidgets/ConfigurePrinterWidget.cs @@ -33,6 +33,7 @@ using MatterHackers.Agg.UI; using MatterHackers.Localizations; using MatterHackers.MatterControl.PartPreviewWindow; using MatterHackers.MatterControl.SlicerConfiguration; +using MatterHackers.VectorMath; namespace MatterHackers.MatterControl { @@ -55,28 +56,18 @@ namespace MatterHackers.MatterControl this.AddChild(rowItem); - var primaryTabControl = new TabControl(); - primaryTabControl.TabBar.BorderColor = ActiveTheme.Instance.PrimaryTextColor; - primaryTabControl.AnchorAll(); + var primaryTabControl = new SimpleTabs(new GuiWidget()) + { + Margin = new BorderDouble(top: 8), + VAnchor = VAnchor.Stretch, + HAnchor = HAnchor.Stretch, + MinimumSize = new Vector2(200, 200) + }; + primaryTabControl.TabBar.BackgroundColor = theme.ActiveTabBarBackground; this.AddChild(primaryTabControl); foreach (var section in SliceSettingsOrganizer.Instance.UserLevels["Printer"].CategoriesList) { - var tabPage = new TabPage(section.Name.Localize()) - { - Padding = new BorderDouble(1, 4) - }; - - primaryTabControl.AddTab(new TextTab( - tabPage, - section.Name + " Tab", - theme.DefaultFontSize, - ActiveTheme.Instance.TabLabelSelected, - new Color(), - ActiveTheme.Instance.TabLabelUnselected, - new Color(), - useUnderlineStyling: true)); - var scrollable = new ScrollableWidget(true) { VAnchor = VAnchor.Stretch, @@ -90,8 +81,22 @@ namespace MatterHackers.MatterControl sliceSettingsWidget.ShowHelpControls, ActiveTheme.Instance.PrimaryTextColor, scrollable.ScrollArea)); - tabPage.AddChild(scrollable); + primaryTabControl.AddTab( + new ToolTab( + section.Name.Localize(), + primaryTabControl, + scrollable, + theme, + hasClose: false) + { + Name = section.Name + " Tab", + InactiveTabColor = Color.Transparent, + ActiveTabColor = theme.ActiveTabColor + }); } + + primaryTabControl.SelectedTabIndex = 0; + } } }