Fix message box vertically center issue when message type is not OK

This commit is contained in:
Jack251970 2025-07-17 11:50:56 +08:00
parent b924a79ccb
commit 890b115b37

View file

@ -37,8 +37,9 @@ namespace Flow.Launcher
try
{
msgBox = new MessageBoxEx(button);
if (caption == string.Empty && button == MessageBoxButton.OK && icon == MessageBoxImage.None)
if (caption == string.Empty && icon == MessageBoxImage.None)
{
// If there is no caption and no icon, use DescOnlyTextBlock for vertically centered text
msgBox.Title = messageBoxText;
msgBox.DescOnlyTextBlock.Visibility = Visibility.Visible;
msgBox.DescOnlyTextBlock.Text = messageBoxText;