diff --git a/ShareX/Forms/NotificationForm.cs b/ShareX/Forms/NotificationForm.cs index 87dc395cb..22d22e51f 100644 --- a/ShareX/Forms/NotificationForm.cs +++ b/ShareX/Forms/NotificationForm.cs @@ -161,7 +161,7 @@ protected override void OnPaint(PaintEventArgs e) g.FillRectangle(brush, textRect); } - g.DrawString(ToastConfig.URL, textFont, Brushes.White, textRect.Offset(-urlPadding)); + TextRenderer.DrawText(g, ToastConfig.URL, textFont, textRect.Offset(-urlPadding), Color.White, TextFormatFlags.Left); } } else if (!string.IsNullOrEmpty(ToastConfig.Text)) @@ -172,8 +172,8 @@ protected override void OnPaint(PaintEventArgs e) } Rectangle textRect = new Rectangle(textPadding, textPadding, textRenderSize.Width + 2, textRenderSize.Height + 2); - g.DrawString(ToastConfig.Text, textFont, Brushes.Black, textRect); - g.DrawString(ToastConfig.Text, textFont, Brushes.White, textRect.LocationOffset(1)); + TextRenderer.DrawText(g, ToastConfig.Text, textFont, textRect, Color.Black, TextFormatFlags.Left); + TextRenderer.DrawText(g, ToastConfig.Text, textFont, textRect.LocationOffset(1), Color.White, TextFormatFlags.Left); } g.DrawRectangleProper(Pens.Black, rect); @@ -258,10 +258,13 @@ private void ExecuteAction(ToastClickAction action) private void NotificationForm_MouseEnter(object sender, EventArgs e) { isMouseInside = true; - Refresh(); - tOpacity.Stop(); - Opacity = 1; + + if (!IsDisposed) + { + Refresh(); + Opacity = 1; + } } private void NotificationForm_MouseLeave(object sender, EventArgs e)