mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
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:
parent
941551945d
commit
8cb2dedb87
8 changed files with 263 additions and 44 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue