diff --git a/CustomWidgets/DockingTabControl.cs b/CustomWidgets/DockingTabControl.cs index ade35159c..fa67cb16e 100644 --- a/CustomWidgets/DockingTabControl.cs +++ b/CustomWidgets/DockingTabControl.cs @@ -157,7 +157,7 @@ namespace MatterHackers.MatterControl.CustomWidgets this.RemoveAllChildren(); - TabControl tabControl = null; + SimpleTabs tabControl = null; if (this.ControlIsPinned) { var resizePage = new ResizeContainer(this) @@ -168,7 +168,18 @@ namespace MatterHackers.MatterControl.CustomWidgets SplitterWidth = theme.SplitterWidth, }; - tabControl = theme.CreateTabControl(); + tabControl = new SimpleTabs(this.CreatePinButton(), theme) + { + VAnchor = VAnchor.Stretch, + HAnchor = HAnchor.Stretch, + }; + tabControl.TabBar.BackgroundColor = theme.ActiveTabColor.AdjustLightness(0.9).ToColor(); + + tabControl.ActiveTabChanged += (s, e) => + { + printer.ViewState.SliceSettingsTabIndex = tabControl.SelectedTabIndex; + }; + resizePage.AddChild(tabControl); this.AddChild(resizePage); @@ -183,24 +194,19 @@ namespace MatterHackers.MatterControl.CustomWidgets { var content = new DockingWindowContent(this, nameWidget.Value, tabTitle); - var tabPage = new TabPage(content, tabTitle); - var textTab = new TextTab( - tabPage, - tabTitle + " Tab", - 12, - ActiveTheme.Instance.TabLabelSelected, - Color.Transparent, - ActiveTheme.Instance.TabLabelUnselected, - Color.Transparent, - useUnderlineStyling: true); - - tabControl.AddTab(textTab); - - int localTabIndex = tabIndex; - textTab.Click += (s, e) => - { - printer.ViewState.SliceSettingsTabIndex = localTabIndex; - }; + tabControl.AddTab( + new ToolTab( + tabTitle, + tabControl, + content, + theme, + hasClose: false, + pointSize: theme.FontSize11) + { + Name = tabTitle + " Tab", + InactiveTabColor = Color.Transparent, + ActiveTabColor = theme.TabBodyBackground + }); } else // control is floating { @@ -291,9 +297,6 @@ namespace MatterHackers.MatterControl.CustomWidgets if (this.ControlIsPinned) { - tabControl.TabBar.AddChild(new HorizontalSpacer()); - tabControl.TabBar.AddChild(this.CreatePinButton()); - tabControl.TabBar.Padding = new BorderDouble(right: theme.ToolbarPadding.Right); if (printer.ViewState.SliceSettingsTabIndex < tabControl.TabCount) diff --git a/PartPreviewWindow/MainTab.cs b/PartPreviewWindow/MainTab.cs index e0c5bc2c1..9cdf4452c 100644 --- a/PartPreviewWindow/MainTab.cs +++ b/PartPreviewWindow/MainTab.cs @@ -139,8 +139,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { public Color InactiveTabColor { get; set; } public Color ActiveTabColor { get; set; } - public ToolTab(string tabLabel, SimpleTabs parentTabControl, GuiWidget tabContent, ThemeConfig theme, string tabImageUrl = null, bool hasClose = true) - : base(tabLabel, parentTabControl, tabContent, theme, tabImageUrl, hasClose, theme.FontSize10) + public ToolTab(string tabLabel, SimpleTabs parentTabControl, GuiWidget tabContent, ThemeConfig theme, string tabImageUrl = null, bool hasClose = true, int pointSize = -1) + : base(tabLabel, parentTabControl, tabContent, theme, tabImageUrl, hasClose, pointSize: (pointSize == -1) ? theme.FontSize10 : pointSize) { tabPill.Padding = tabPill.Padding.Clone(top: 9, bottom: 10); } diff --git a/PartPreviewWindow/Toolbar.cs b/PartPreviewWindow/Toolbar.cs index 6080e0391..d60228286 100644 --- a/PartPreviewWindow/Toolbar.cs +++ b/PartPreviewWindow/Toolbar.cs @@ -110,7 +110,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow public int TabCount => _allTabs.Count; - public void AddTab(GuiWidget tabWidget, int position) + public void AddTab(GuiWidget tabWidget, int position = -1) { var iTab = tabWidget as ITab; diff --git a/SlicerConfiguration/SliceSettingsWidget.cs b/SlicerConfiguration/SliceSettingsWidget.cs index 580589488..149c43e20 100644 --- a/SlicerConfiguration/SliceSettingsWidget.cs +++ b/SlicerConfiguration/SliceSettingsWidget.cs @@ -111,7 +111,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration HAnchor = HAnchor.Stretch, MinimumSize = new Vector2(200, 200) }; - primaryTabControl.TabBar.BackgroundColor = theme.ActiveTabColor.AdjustLightness(0.85).ToColor(); + primaryTabControl.TabBar.BackgroundColor = theme.ActiveTabColor.AdjustLightness(0.9).ToColor(); for (int topCategoryIndex = 0; topCategoryIndex < SliceSettingsOrganizer.Instance.UserLevels[UserLevel].CategoriesList.Count; topCategoryIndex++) {