mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-06 05:05:42 +13:00
e4a7bf62d6
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
43 lines
No EOL
1.6 KiB
C#
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();
|
|
}
|
|
}
|
|
} |