Skip to content

Commit

Permalink
minor fix with notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
mbnq committed Oct 14, 2024
1 parent c5f5e3e commit e68efe2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ internal static class Program
static Mutex redunDancerMutex = new Mutex(true, "{readunDancer}");

#region variables and constants
public const string mbVersion = "0.0.1.4";
public const string mbVersion = "0.0.1.6";
#endregion

#region DPI
Expand Down
7 changes: 5 additions & 2 deletions core/mbGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,11 @@ private void checkIPSettings()
}
public void PopUpNotification(string title, string message, int timeout)
{
mbNotificationForm notification = new mbNotificationForm(title, message, timeout);
notification.Show();
if (showNotifications)
{
mbNotificationForm notification = new mbNotificationForm(title, message, timeout);
notification.Show();
}
}
private void StartCheckboxLock()
{
Expand Down
8 changes: 2 additions & 6 deletions core/mbNotification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,11 @@ public mbNotificationForm(string title, string message, int timeout = 3000)
mbTitleLabel.Click += (s, e) => this.Hide();
mbMessageLabel.Click += (s, e) => this.Hide();

if (mbRedunDancerMain.showNotifications)
{
this.Show();
mbKillWithDelay(timeout);
}
this.Show();
mbKillWithDelay(timeout);
}
private async void mbKillWithDelay(int timeout)
{
this.Opacity = 80;
await Task.Delay(timeout);
this.Close();
}
Expand Down

0 comments on commit e68efe2

Please sign in to comment.