Merge pull request #3838 from Flow-Launcher/message_box_ex_vertically_center

Fix message box vertically center issue when message type is not OK
This commit is contained in:
Jack Ye 2025-07-17 20:05:07 +08:00 committed by GitHub
commit 09781b1328
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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;