Skip to content

Commit

Permalink
Rename annotation panel size editor setting
Browse files Browse the repository at this point in the history
  • Loading branch information
glopesdev committed Jun 12, 2023
1 parent 345f7bd commit 6a9cf7a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Bonsai.Editor/EditorForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,13 @@ void RestoreEditorSettings()
WindowState = EditorSettings.Instance.WindowState;
themeRenderer.ActiveTheme = EditorSettings.Instance.EditorTheme;
editorControl.AnnotationPanelSize = (int)Math.Round(
EditorSettings.Instance.WebViewSize * scaleFactor.Width);
EditorSettings.Instance.AnnotationPanelSize * scaleFactor.Width);
}

void CloseEditorForm()
{
Application.RemoveMessageFilter(hotKeys);
EditorSettings.Instance.WebViewSize = (int)Math.Round(
EditorSettings.Instance.AnnotationPanelSize = (int)Math.Round(
editorControl.AnnotationPanelSize * inverseScaleFactor.Width);
var desktopBounds = WindowState != FormWindowState.Normal ? RestoreBounds : Bounds;
EditorSettings.Instance.DesktopBounds = ScaleBounds(desktopBounds, inverseScaleFactor);
Expand Down
12 changes: 6 additions & 6 deletions Bonsai.Editor/EditorSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sealed class EditorSettings

internal EditorSettings(string path)
{
WebViewSize = 400;
AnnotationPanelSize = 400;
settingsPath = path;
}

Expand All @@ -35,7 +35,7 @@ public static EditorSettings Instance

public ColorTheme EditorTheme { get; set; }

public int WebViewSize { get; set; }
public int AnnotationPanelSize { get; set; }

public RecentlyUsedFileCollection RecentlyUsedFiles
{
Expand Down Expand Up @@ -69,10 +69,10 @@ static EditorSettings Load()
Enum.TryParse(reader.ReadElementContentAsString(), out ColorTheme editorTheme);
settings.EditorTheme = editorTheme;
}
else if (reader.Name == nameof(WebViewSize))
else if (reader.Name == nameof(AnnotationPanelSize))
{
int.TryParse(reader.ReadElementContentAsString(), out int webViewSize);
settings.WebViewSize = webViewSize;
int.TryParse(reader.ReadElementContentAsString(), out int annotationPanelSize);
settings.AnnotationPanelSize = annotationPanelSize;
}
else if (reader.Name == nameof(DesktopBounds))
{
Expand Down Expand Up @@ -119,7 +119,7 @@ public void Save()
writer.WriteStartElement(typeof(EditorSettings).Name);
writer.WriteElementString(nameof(WindowState), WindowState.ToString());
writer.WriteElementString(nameof(EditorTheme), EditorTheme.ToString());
writer.WriteElementString(nameof(WebViewSize), WebViewSize.ToString(CultureInfo.InvariantCulture));
writer.WriteElementString(nameof(AnnotationPanelSize), AnnotationPanelSize.ToString(CultureInfo.InvariantCulture));

writer.WriteStartElement(nameof(DesktopBounds));
writer.WriteElementString(nameof(Rectangle.X), DesktopBounds.X.ToString(CultureInfo.InvariantCulture));
Expand Down

0 comments on commit 6a9cf7a

Please sign in to comment.