Fix unicode emoji issues in notification form

This commit is contained in:
Jaex 2019-01-27 06:51:10 +03:00
parent 51ccc98872
commit d1fdae51e2

View file

@ -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)