mirror of
https://github.com/LorenzCK/OnTopReplica.git
synced 2024-05-10 07:22:29 +12:00
Save current Opacity when hiding the form in order to be able to restore the value when form is restored
fixes #12
This commit is contained in:
parent
01e13034a4
commit
9b0a007242
|
@ -73,7 +73,6 @@ namespace OnTopReplica {
|
|||
//Reset special modes
|
||||
FullscreenManager.SwitchBack();
|
||||
ClickThroughEnabled = false;
|
||||
Opacity = 1.0;
|
||||
|
||||
//Restore main form in a platform-dependent method
|
||||
Program.Platform.RestoreForm(this);
|
||||
|
|
|
@ -7,6 +7,8 @@ namespace OnTopReplica.Platforms {
|
|||
|
||||
class WindowsSeven : WindowsVista {
|
||||
|
||||
private double? PreviousOpacity { get; set; }
|
||||
|
||||
public override void PreHandleFormInit() {
|
||||
//Set Application ID
|
||||
WindowsSevenMethods.SetCurrentProcessExplicitAppUserModelID("LorenzCunoKlopfenstein.OnTopReplica.MainForm");
|
||||
|
@ -19,6 +21,7 @@ namespace OnTopReplica.Platforms {
|
|||
}
|
||||
|
||||
public override void HideForm(MainForm form) {
|
||||
PreviousOpacity = form.Opacity;
|
||||
form.Opacity = 0;
|
||||
}
|
||||
|
||||
|
@ -27,8 +30,10 @@ namespace OnTopReplica.Platforms {
|
|||
}
|
||||
|
||||
public override void RestoreForm(MainForm form) {
|
||||
if (form.Opacity == 0.0)
|
||||
form.Opacity = 1.0;
|
||||
if (form.Opacity == 0.0) {
|
||||
form.Opacity = PreviousOpacity.GetValueOrDefault(1.0);
|
||||
PreviousOpacity = null;
|
||||
}
|
||||
|
||||
form.Show();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue