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

@@ -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;