Next step for having the settings of effects stored in the greenshot.ini, using a TypeConverter this seems to work. An important change to the IniValue.cs: here a default value is created when the ini doesn't have a value yet. This used to be just "null". Next step would be that settings forms get a reset/default button. [skip ci]

This commit is contained in:
RKrom 2014-11-17 12:49:06 +01:00
commit 8cb2dedb87
8 changed files with 263 additions and 44 deletions

View file

@ -27,20 +27,33 @@ using GreenshotPlugin.Core;
namespace Greenshot.Forms {
public partial class DropShadowSettingsForm : BaseForm {
private DropShadowEffect effect;
public DropShadowSettingsForm(DropShadowEffect effect) {
this.effect = effect;
InitializeComponent();
this.Icon = GreenshotResources.getGreenshotIcon();
ShowSettings();
}
/// <summary>
/// Apply the settings from the effect to the view
/// </summary>
private void ShowSettings() {
trackBar1.Value = (int)(effect.Darkness * 40);
offsetX.Value = effect.ShadowOffset.X;
offsetY.Value = effect.ShadowOffset.Y;
}
private void buttonOK_Click(object sender, EventArgs e) {
private void ButtonOK_Click(object sender, EventArgs e) {
effect.Darkness = (float)trackBar1.Value / (float)40;
effect.ShadowOffset = new Point((int)offsetX.Value, (int)offsetY.Value);
effect.ShadowSize = (int)thickness.Value;
DialogResult = DialogResult.OK;
}
private void ButtonReset_Click(object sender, EventArgs e) {
effect.Reset();
ShowSettings();
}
}
}