From 859a8938c09ba498d68a4d15d2f2f92bc0f1339c Mon Sep 17 00:00:00 2001 From: mshafer1 <2565361+mshafer1@users.noreply.github.com> Date: Sat, 21 Dec 2024 08:22:47 -0600 Subject: [PATCH] remove IsVisible and just use Visible instead --- ntfysh_client/NotificationDialog.cs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/ntfysh_client/NotificationDialog.cs b/ntfysh_client/NotificationDialog.cs index f7d0a90..f917ab2 100644 --- a/ntfysh_client/NotificationDialog.cs +++ b/ntfysh_client/NotificationDialog.cs @@ -22,16 +22,10 @@ namespace ntfysh_client private Stopwatch? _shownStopwatch = null; private ToolTipIcon? _icon; - public bool IsVisible - { - get { return Visible; } - set { Visible = value; } - } - public NotificationDialog() { ShowInTaskbar = false; - IsVisible = false; + Visible = false; TopMost = true; InitializeComponent(); InitializeWindowHidden(); @@ -39,7 +33,7 @@ namespace ntfysh_client public void ShowNotification(string title, string message, int timeout_ms = -1, ToolTipIcon? icon = null, bool showTimeOutBar = true, bool showInDarkMode = true) { - if (IsVisible) + if (Visible) { // close the current notification HandleTimeout(null, null); @@ -151,7 +145,7 @@ namespace ntfysh_client flags: NFWinUserAnimateWindowConstnats.AW_SLIDE | NFWinUserAnimateWindowConstnats.AW_VER_POSITIVE | NFWinUserAnimateWindowConstnats.AW_HIDE ); - IsVisible = false; + Visible = false; } private void HandleTimeout(object? sender, EventArgs? e) @@ -182,14 +176,14 @@ namespace ntfysh_client { Opacity = 0; ShowNotification("Title", "Message"); - IsVisible = false; + Visible = false; Opacity = 1; } private void btnClose_Click(object sender, EventArgs e) { // don't animate, immediately "close" - IsVisible = false; + Visible = false; } private class NFWinUserAnimateWindowConstnats