ShareX/Greenshot.ImageEditor/Forms/EditorSettingsForm.cs
campbeb e4a7bf62d6 Default and last drawing modes in Greenshot
Adds setting to allow user to save the last drawing mode used in Greenshot
so that it will be selected next time image editor is opened.
Also adds setting to config file to allow user to change the default
drawing mode.
Closes #1609
2016-06-11 00:31:26 -04:00

43 lines
No EOL
1.6 KiB
C#

using Greenshot.Configuration;
using Greenshot.IniFile;
using GreenshotPlugin.Core;
using System;
using System.Drawing;
using System.Windows.Forms;
namespace Greenshot
{
public partial class EditorSettingsForm : Form
{
private static CoreConfiguration coreConfiguration = IniConfig.GetIniSection<CoreConfiguration>();
private static EditorConfiguration editorConfiguration = IniConfig.GetIniSection<EditorConfiguration>();
public EditorSettingsForm()
{
InitializeComponent();
Icon = GreenshotResources.getGreenshotIcon();
LoadSettings();
}
private void LoadSettings()
{
nudIconSize.Value = (int)Math.Round(coreConfiguration.IconSize.Width / 16.0) * 16;
cbMatchSizeToCapture.Checked = editorConfiguration.MatchSizeToCapture;
cbSuppressSaveDialogAtClose.Checked = editorConfiguration.SuppressSaveDialogAtClose;
cbRememberLastDrawingMode.Checked = editorConfiguration.RememberLastDrawingMode;
}
private void SaveSettings()
{
coreConfiguration.IconSize = new Size((int)nudIconSize.Value, (int)nudIconSize.Value);
editorConfiguration.MatchSizeToCapture = cbMatchSizeToCapture.Checked;
editorConfiguration.SuppressSaveDialogAtClose = cbSuppressSaveDialogAtClose.Checked;
editorConfiguration.RememberLastDrawingMode = cbRememberLastDrawingMode.Checked;
}
private void btnOK_Click(object sender, EventArgs e)
{
SaveSettings();
}
}
}