mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 19:22:53 +01:00
Change Opacity when the form is Deactivated
This commit is contained in:
parent
f805ec48c2
commit
4c1dcd6c77
2
src/Forms/MeasurementConverter.Designer.cs
generated
2
src/Forms/MeasurementConverter.Designer.cs
generated
@ -179,6 +179,8 @@
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Measurement converter";
|
||||
this.Activated += new System.EventHandler(this.MeasurementConverter_Activated);
|
||||
this.Deactivate += new System.EventHandler(this.MeasurementConverter_Deactivate);
|
||||
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MeasurementConverter_FormClosed);
|
||||
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MeasurementConverter_KeyDown);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
@ -4877,6 +4877,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void MeasurementConverter_Activated(object sender, EventArgs e)
|
||||
{
|
||||
this.Opacity = 1;
|
||||
if (double.TryParse(Input, out _))
|
||||
{
|
||||
textBoxInput.Text = Input;
|
||||
@ -4886,5 +4887,18 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
textBoxInput.Text = "1";
|
||||
}
|
||||
}
|
||||
|
||||
private void MeasurementConverter_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
|
||||
private void MeasurementConverter_Deactivate(object sender, EventArgs e)
|
||||
{
|
||||
if (DialogResult != DialogResult.Cancel)
|
||||
{
|
||||
this.Opacity = 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user