Use same zone set initially for new virtual desktops of same monitor (#815)

This commit is contained in:
vldmr11080
2019-12-06 15:09:27 +01:00
committed by Enrico Giordani
parent add63d2dde
commit 014c2c5249
4 changed files with 32 additions and 35 deletions

View File

@@ -36,7 +36,7 @@ namespace FancyZonesEditor
return false;
}
}
public Settings()
{
ParseCommandLineArgs();
@@ -64,9 +64,9 @@ namespace FancyZonesEditor
_blankCustomModel = new CanvasLayoutModel("Create new custom", c_blankCustomModelId, (int)_workArea.Width, (int)_workArea.Height);
_zoneCount = (int)Registry.GetValue(_uniqueRegistryPath, "ZoneCount", 3);
_spacing = (int)Registry.GetValue(_uniqueRegistryPath, "Spacing", 16);
_showSpacing = (int)Registry.GetValue(_uniqueRegistryPath, "ShowSpacing", 1) == 1;
_zoneCount = ReadRegistryInt("ZoneCount", 3);
_spacing = ReadRegistryInt("Spacing", 16);
_showSpacing = ReadRegistryInt("ShowSpacing", 1) == 1;
UpdateLayoutModels();
}
@@ -181,6 +181,12 @@ namespace FancyZonesEditor
}
private static float _dpi;
private int ReadRegistryInt(string valueName, int defaultValue)
{
object obj = Registry.GetValue(_uniqueRegistryPath, valueName, defaultValue);
return (obj != null) ? (int)obj : defaultValue;
}
// UpdateLayoutModels
// Update the five default layouts based on the new ZoneCount
private void UpdateLayoutModels()