DiagramOption LayoutOption 参数整理

This commit is contained in:
kwai
2023-05-11 19:14:39 +08:00
parent 2045c5e45c
commit f995722828
51 changed files with 589 additions and 637 deletions

View File

@@ -40,10 +40,10 @@ namespace AIStudio.Wpf.Mind.Controls
public MindEditor()
{
_diagramViewModel = new MindDiagramViewModel();
_diagramViewModel.GridMarginSize = new Size(0, 0);
_diagramViewModel.PageSizeType = PageSizeType.Custom;
_diagramViewModel.PageSize = new SizeBase(1000d, 1000d);
_diagramViewModel.ShowGrid= false;
_diagramViewModel.DiagramOption.LayoutOption.GridMarginSize = new Size(0, 0);
_diagramViewModel.DiagramOption.LayoutOption.PageSizeType = PageSizeType.Custom;
_diagramViewModel.DiagramOption.LayoutOption.PageSize = new SizeBase(1000d, 1000d);
_diagramViewModel.DiagramOption.LayoutOption.ShowGrid = false;
_diagramViewModel.DefaultZoomBox = true;
_diagramViewModel.PropertyChanged += DiagramViewModel_PropertyChanged;

View File

@@ -1132,11 +1132,11 @@ namespace AIStudio.Wpf.Mind.ViewModels
var mindThemeModel = MindThemeHelper.GetTheme(newMindTheme);
if (mindThemeModel?.Dark == true)
{
PageBackground = Colors.Black;
DiagramOption.LayoutOption.PageBackground = Colors.Black;
}
else
{
PageBackground = Colors.White;
DiagramOption.LayoutOption.PageBackground = Colors.White;
}
roots.ForEach(p => p.MindTheme = newMindTheme);
roots.SelectMany(p => p.GetChildren(true)).ToList().ForEach(item => { item.ThemeChange(); });
@@ -1146,11 +1146,11 @@ namespace AIStudio.Wpf.Mind.ViewModels
var mindThemeModel = MindThemeHelper.GetTheme(oldMindTheme);
if (mindThemeModel?.Dark == true)
{
PageBackground = Colors.Black;
DiagramOption.LayoutOption.PageBackground = Colors.Black;
}
else
{
PageBackground = Colors.White;
DiagramOption.LayoutOption.PageBackground = Colors.White;
}
roots.ForEach(p => p.MindTheme = oldMindTheme);
roots.SelectMany(p => p.GetChildren(true)).ToList().ForEach(item => { item.ThemeChange(); });
@@ -1275,9 +1275,9 @@ namespace AIStudio.Wpf.Mind.ViewModels
{
if (left == null)
left = (PageSize.Width - rootitem.ItemWidth) / 2;
left = (DiagramOption.LayoutOption.PageSize.Width - rootitem.ItemWidth) / 2;
if (top == null)
top = (PageSize.Height - rootitem.ItemHeight) / 2;
top = (DiagramOption.LayoutOption.PageSize.Height - rootitem.ItemHeight) / 2;
var offset = rootitem.Offset;
rootitem.Left = left.Value;
rootitem.Top = top.Value;