Splitter can have a ration and min sizes
fixed history / properties splitter to have a ratio
This commit is contained in:
parent
fcdb76e672
commit
33374fecfd
5 changed files with 22 additions and 15 deletions
|
|
@ -675,21 +675,20 @@ namespace MatterHackers.MatterControl
|
|||
}
|
||||
}
|
||||
|
||||
public double SceneTreeHeight
|
||||
public double SceneTreeRatio
|
||||
{
|
||||
get
|
||||
{
|
||||
if (double.TryParse(UserSettings.Instance.get(UserSettingsKey.SceneTreeHeight), out double controlHeight))
|
||||
if (double.TryParse(UserSettings.Instance.get(UserSettingsKey.SceneTreeRatio), out double treeRatio))
|
||||
{
|
||||
return Math.Max(controlHeight, 35);
|
||||
return treeRatio;
|
||||
}
|
||||
|
||||
return 35;
|
||||
return .75;
|
||||
}
|
||||
set
|
||||
{
|
||||
var minimumValue = Math.Max(value, 35);
|
||||
UserSettings.Instance.set(UserSettingsKey.SceneTreeHeight, minimumValue.ToString());
|
||||
UserSettings.Instance.set(UserSettingsKey.SceneTreeRatio, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -160,9 +160,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
scrollableWidget.AddChild(editorPanel);
|
||||
scrollableWidget.ScrollArea.HAnchor = HAnchor.Stretch;
|
||||
|
||||
editorSectionWidget = new SectionWidget("Editor", scrollableWidget, theme, toolbar, serializationKey: UserSettingsKey.EditorPanelExpanded, defaultExpansion: true, setContentVAnchor: false)
|
||||
editorSectionWidget = new SectionWidget("Editor", scrollableWidget, theme, toolbar, serializationKey: UserSettingsKey.EditorPanelExpanded, expandingContent: false, defaultExpansion: true, setContentVAnchor: false)
|
||||
{
|
||||
VAnchor = VAnchor.Stretch,
|
||||
VAnchor = VAnchor.Stretch
|
||||
};
|
||||
this.AddChild(editorSectionWidget);
|
||||
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
modelViewSidePanel = new LeftResizeContainer(theme)
|
||||
{
|
||||
Width = printer?.ViewState.SelectedObjectPanelWidth ?? 200,
|
||||
Width = printer?.ViewState.SelectedObjectPanelWidth ?? 250,
|
||||
VAnchor = VAnchor.Stretch,
|
||||
HAnchor = HAnchor.Absolute,
|
||||
BackgroundColor = theme.InteractionLayerOverlayColor,
|
||||
|
|
@ -223,10 +223,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
Splitter historyAndProperties = new Splitter()
|
||||
{
|
||||
Orientation = Orientation.Horizontal,
|
||||
SplitterDistance = sceneContext.ViewState.SceneTreeHeight,
|
||||
Panel1Ratio = sceneContext.ViewState.SceneTreeRatio,
|
||||
SplitterSize = theme.SplitterWidth,
|
||||
SplitterBackground = theme.SplitterBackground
|
||||
};
|
||||
historyAndProperties.Panel1.MinimumSize = new Vector2(0, 120);
|
||||
historyAndProperties.Panel2.MinimumSize = new Vector2(0, 120);
|
||||
|
||||
modelViewSidePanel.AddChild(historyAndProperties);
|
||||
|
||||
|
|
@ -234,7 +236,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
historyAndProperties.DistanceChanged += (s, e) =>
|
||||
{
|
||||
sceneContext.ViewState.SceneTreeHeight = historyAndProperties.SplitterDistance;
|
||||
sceneContext.ViewState.SceneTreeRatio = historyAndProperties.Panel1Ratio;
|
||||
};
|
||||
|
||||
historyAndProperties.Panel2.AddChild(selectedObjectPanel);
|
||||
|
|
@ -280,7 +282,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
viewOptionsBar.AddChild(modelViewStyleButton);
|
||||
|
||||
printer.ViewState.ViewModeChanged += this.ViewState_ViewModeChanged;
|
||||
if (printer?.ViewState != null)
|
||||
{
|
||||
printer.ViewState.ViewModeChanged += this.ViewState_ViewModeChanged;
|
||||
}
|
||||
|
||||
ApplicationController.Instance.GetViewOptionButtons(viewOptionsBar, sceneContext, printer, theme);
|
||||
|
||||
|
|
@ -437,7 +442,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
Scene.SelectionChanged -= Scene_SelectionChanged;
|
||||
this.InteractionLayer.DrawGlOpaqueContent -= Draw_GlOpaqueContent;
|
||||
this.sceneContext.SceneLoaded -= SceneContext_SceneLoaded;
|
||||
printer.ViewState.ViewModeChanged -= this.ViewState_ViewModeChanged;
|
||||
if (printer?.ViewState != null)
|
||||
{
|
||||
printer.ViewState.ViewModeChanged -= this.ViewState_ViewModeChanged;
|
||||
}
|
||||
|
||||
modelViewSidePanel.Resized -= ModelViewSidePanel_Resized;
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ namespace MatterHackers.MatterControl
|
|||
public const string UpdateFeedType = nameof(UpdateFeedType);
|
||||
public const string LastReadWhatsNew = nameof(LastReadWhatsNew);
|
||||
public const string ActiveThemeName = nameof(ActiveThemeName);
|
||||
public const string SceneTreeHeight = nameof(SceneTreeHeight);
|
||||
public const string SceneTreeRatio = nameof(SceneTreeRatio);
|
||||
public const string SelectedObjectEditorHeight = nameof(SelectedObjectEditorHeight);
|
||||
public const string SelectionTreeViewPanelExpanded = nameof(SelectionTreeViewPanelExpanded);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 17d30ea8103851a07d2d92ea5765fc947b8dffb5
|
||||
Subproject commit 45c8b034752b11b7a7f584148845865dd39f24de
|
||||
Loading…
Add table
Add a link
Reference in a new issue