Add ResizableSectionWidget expansion persistence
This commit is contained in:
parent
5c1a453a75
commit
d5d8f000f8
4 changed files with 5 additions and 4 deletions
|
|
@ -41,7 +41,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
public event EventHandler Resized;
|
||||
|
||||
public ResizableSectionWidget(string sectionTitle, double initialHeight, GuiWidget sectionContent, ThemeConfig theme, GuiWidget rightAlignedContent = null, int headingPointSize = -1, bool expandingContent = true, bool expanded = true, string serializationKey = null, bool defaultExpansion = false, bool setContentVAnchor = true)
|
||||
: base(sectionTitle, new GuiWidget(), theme, rightAlignedContent, headingPointSize, expanded, expanded, serializationKey, defaultExpansion, setContentVAnchor)
|
||||
: base(sectionTitle, new GuiWidget(), theme, rightAlignedContent, headingPointSize, expandingContent, expanded, serializationKey, defaultExpansion, setContentVAnchor)
|
||||
{
|
||||
this.VAnchor = VAnchor.Fit;
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
HAnchor = HAnchor.Stretch,
|
||||
VAnchor = VAnchor.Fit,
|
||||
Name = "editorRootContainer",
|
||||
Visible = expanded
|
||||
Visible = checkbox.Checked
|
||||
};
|
||||
resizeWrapper.AddChild(this.ResizeContainer);
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
|
|||
/// </summary>
|
||||
public class SectionWidget : FlowLayoutWidget, IIgnoredPopupChild
|
||||
{
|
||||
private ExpandCheckboxButton checkbox;
|
||||
protected ExpandCheckboxButton checkbox;
|
||||
private bool setContentVAnchor;
|
||||
|
||||
public SectionWidget(string sectionTitle, GuiWidget sectionContent, ThemeConfig theme, GuiWidget rightAlignedContent = null, int headingPointSize = -1, bool expandingContent = true, bool expanded = true, string serializationKey = null, bool defaultExpansion = false, bool setContentVAnchor = true)
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
}
|
||||
};
|
||||
|
||||
var treeSection = new ResizableSectionWidget("Design History".Localize(), sceneContext.ViewState.SceneTreeHeight, treeView, theme, expanded: false);
|
||||
var treeSection = new ResizableSectionWidget("Design History".Localize(), sceneContext.ViewState.SceneTreeHeight, treeView, theme, serializationKey: UserSettingsKey.SelectionTreeViewPanelExpanded);
|
||||
treeSection.Resized += (s, e) =>
|
||||
{
|
||||
sceneContext.ViewState.SceneTreeHeight = treeSection.ResizeContainer.Height;
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ namespace MatterHackers.MatterControl
|
|||
public const string ActiveThemeName = nameof(ActiveThemeName);
|
||||
public const string SceneTreeHeight = nameof(SceneTreeHeight);
|
||||
public const string SelectedObjectEditorHeight = nameof(SelectedObjectEditorHeight);
|
||||
public const string SelectionTreeViewPanelExpanded = nameof(SelectionTreeViewPanelExpanded);
|
||||
}
|
||||
|
||||
public class UserSettings
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue