mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Improve OK MessageBoxEx display style
This commit is contained in:
parent
ab087bd927
commit
fd78972c2f
2 changed files with 32 additions and 9 deletions
|
|
@ -60,8 +60,12 @@
|
|||
</Grid>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="1" Margin="30 0 30 24">
|
||||
<Grid Grid.Column="0" Margin="0 0 0 12">
|
||||
<Grid Grid.Row="1" Margin="30 0 30 24">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0" Margin="0 0 0 12">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
|
|
@ -91,14 +95,25 @@
|
|||
</Grid>
|
||||
<TextBlock
|
||||
x:Name="DescTextBlock"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
MaxWidth="400"
|
||||
Margin="0 0 26 0"
|
||||
HorizontalAlignment="Stretch"
|
||||
FontSize="14"
|
||||
TextAlignment="Left"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
<TextBlock
|
||||
x:Name="DescOnlyTextBlock"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
MaxWidth="400"
|
||||
Margin="0 0 26 0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
TextAlignment="Left"
|
||||
TextWrapping="Wrap" />
|
||||
</Grid>
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
Margin="0 0 0 0"
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ namespace Flow.Launcher.Core
|
|||
/// 1 parameter
|
||||
public static MessageBoxResult Show(string messageBoxText)
|
||||
{
|
||||
return Show(string.Empty, messageBoxText, MessageBoxButton.OK, MessageBoxImage.None);
|
||||
return Show(messageBoxText, string.Empty, MessageBoxButton.OK, MessageBoxImage.None);
|
||||
}
|
||||
|
||||
// 2 parameter
|
||||
|
|
@ -80,11 +80,19 @@ namespace Flow.Launcher.Core
|
|||
public static MessageBoxResult Show(string messageBoxText, string title, MessageBoxButton button, MessageBoxImage image)
|
||||
{
|
||||
msgBox = new MessageBoxEx();
|
||||
msgBox.TitleTextBlock.Text = title;
|
||||
msgBox.DescTextBlock.Text = messageBoxText;
|
||||
msgBox.Title = title;
|
||||
if (title == string.Empty && button == MessageBoxButton.OK && image == MessageBoxImage.None)
|
||||
{
|
||||
msgBox.DescOnlyTextBlock.Text = messageBoxText;
|
||||
msgBox.Title = messageBoxText;
|
||||
}
|
||||
else
|
||||
{
|
||||
msgBox.TitleTextBlock.Text = title;
|
||||
msgBox.DescTextBlock.Text = messageBoxText;
|
||||
msgBox.Title = title;
|
||||
SetImageOfMessageBox(image);
|
||||
}
|
||||
SetVisibilityOfButtons(button);
|
||||
SetImageOfMessageBox(image);
|
||||
msgBox.ShowDialog();
|
||||
return _result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue