From 4afadaffc151c308de6585f2c0429f541bd1fea9 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Wed, 7 Jan 2015 16:11:12 -0800 Subject: [PATCH] Put in the ability to get the size of the tab bar for the queue window Made the tab bar fit to children so it holds all it's buttons Made the first panel always fit the size of the queue tab bar put in a layers description for z gap in settings --- ApplicationView/CompactSlidePanel.cs | 4 ++++ ApplicationView/FirstPanelTabView.cs | 2 +- ApplicationView/WidescreenPanel.cs | 17 ++++------------- StaticData/SliceSettings/Properties.json | 2 +- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/ApplicationView/CompactSlidePanel.cs b/ApplicationView/CompactSlidePanel.cs index 42cecaec2..47fff57e7 100644 --- a/ApplicationView/CompactSlidePanel.cs +++ b/ApplicationView/CompactSlidePanel.cs @@ -69,6 +69,8 @@ namespace MatterHackers.MatterControl get { return GetPanel(1); } } + public double TabBarWidth { get { return mainControlsTabControl.Width; } } + static int lastPanelIndexBeforeReload = 0; public CompactSlidePanel(QueueDataView queueDataView) : base(2) @@ -108,6 +110,8 @@ namespace MatterHackers.MatterControl mainControlsTabControl.TabBar.AddChild(hSpacer); mainControlsTabControl.TabBar.AddChild(advancedControlsLinkButton); + mainControlsTabControl.TabBar.HAnchor = HAnchor.Max_FitToChildren_ParentWidth; + mainControlsTabControl.HAnchor = HAnchor.Max_FitToChildren_ParentWidth; this.LeftPanel.AddChild(mainControlsTabControl); } diff --git a/ApplicationView/FirstPanelTabView.cs b/ApplicationView/FirstPanelTabView.cs index fbdc2d945..f066195c0 100644 --- a/ApplicationView/FirstPanelTabView.cs +++ b/ApplicationView/FirstPanelTabView.cs @@ -51,7 +51,7 @@ using MatterHackers.MatterControl.PrintHistory; namespace MatterHackers.MatterControl { - class FirstPanelTabView : TabControl + public class FirstPanelTabView : TabControl { public static int firstPanelCurrentTab = 0; diff --git a/ApplicationView/WidescreenPanel.cs b/ApplicationView/WidescreenPanel.cs index 10a7225d2..0ff73e6ae 100644 --- a/ApplicationView/WidescreenPanel.cs +++ b/ApplicationView/WidescreenPanel.cs @@ -57,7 +57,6 @@ namespace MatterHackers.MatterControl static readonly int ColumnOneFixedWidth = 590; static int lastNumberOfVisiblePanels; - public TabPage AboutTabPage; TextImageButtonFactory advancedControlsButtonFactory = new TextImageButtonFactory(); RGBA_Bytes unselectedTextColor = ActiveTheme.Instance.TabLabelUnselected; @@ -145,27 +144,18 @@ namespace MatterHackers.MatterControl } } + CompactSlidePanel compactSlidePanel; void LoadCompactView() { queueDataView = new QueueDataView(); ColumnOne.RemoveAllChildren(); ColumnOne.AddChild(new ActionBarPlus(queueDataView)); - ColumnOne.AddChild(new CompactSlidePanel(queueDataView)); + compactSlidePanel = new CompactSlidePanel(queueDataView); + ColumnOne.AddChild(compactSlidePanel); ColumnOne.AnchorAll(); } - void LoadColumnOne() - { - queueDataView = new QueueDataView(); - - ColumnOne.VAnchor = VAnchor.ParentBottomTop; - ColumnOne.AddChild(new ActionBarPlus(queueDataView)); - ColumnOne.AddChild(new PrintProgressBar()); - ColumnOne.AddChild(new FirstPanelTabView(queueDataView)); - ColumnOne.Width = ColumnOneFixedWidth; //Ordering here matters - must go after children are added - } - void LoadColumnTwo(object state = null) { ColumnTwo.CloseAndRemoveAllChildren(); @@ -242,6 +232,7 @@ namespace MatterHackers.MatterControl ColumnTwo.Visible = true; ColumnOne.HAnchor = Agg.UI.HAnchor.None; ColumnOne.Width = ColumnOneFixedWidth; // it can hold the slice settings so it needs to be bigger. + ColumnOne.MinimumSize = new Vector2(Math.Max(compactSlidePanel.TabBarWidth, ColumnOneFixedWidth), 0); //Ordering here matters - must go after children are added break; } } diff --git a/StaticData/SliceSettings/Properties.json b/StaticData/SliceSettings/Properties.json index 10e2b940c..43d1f28cb 100644 --- a/StaticData/SliceSettings/Properties.json +++ b/StaticData/SliceSettings/Properties.json @@ -939,7 +939,7 @@ "PresentationName": "Z Gap", "HelpText": "The number of layers to skip in z. The gap between the support and the model.", "DataEditType": "INT", - "ExtraSettings": "" + "ExtraSettings": "layers" }, { "SlicerConfigName": "support_material",