Skip to content

Commit e2450cf

Browse files
committed
Adjust MessageBox Window
1 parent 1560991 commit e2450cf

File tree

4 files changed

+29
-19
lines changed

4 files changed

+29
-19
lines changed

Flow.Launcher/Languages/en.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@
348348
<system:String x:Key="commonCancel">Cancel</system:String>
349349
<system:String x:Key="commonReset">Reset</system:String>
350350
<system:String x:Key="commonDelete">Delete</system:String>
351+
<system:String x:Key="commonOK">OK</system:String>
352+
<system:String x:Key="commonYes">Yes</system:String>
353+
<system:String x:Key="commonNo">No</system:String>
351354

352355
<!-- Crash Reporter -->
353356
<system:String x:Key="reportWindow_version">Version</system:String>

Flow.Launcher/MessageBoxEx.xaml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
x:Name="MessageBoxWindow"
99
Width="420"
1010
Height="Auto"
11+
Background="{DynamicResource PopuBGColor}"
12+
Foreground="{DynamicResource PopupTextColor}"
1113
ResizeMode="NoResize"
1214
SizeToContent="Height"
1315
WindowStartupLocation="CenterScreen"
@@ -61,8 +63,8 @@
6163
</Grid>
6264
</StackPanel>
6365
</StackPanel>
64-
<StackPanel Grid.Row="1" Margin="0,0,0,24">
65-
<Grid Grid.Column="0" Margin="0,0,0,12">
66+
<StackPanel Grid.Row="1" Margin="30 0 30 24">
67+
<Grid Grid.Column="0" Margin="0 0 0 12">
6668
<Grid.ColumnDefinitions>
6769
<ColumnDefinition Width="Auto" />
6870
<ColumnDefinition Width="*" />
@@ -72,17 +74,18 @@
7274
Grid.Column="0"
7375
Width="18"
7476
Height="18"
75-
Margin="30,10,0,0"
77+
Margin="0 0 0 0"
7678
HorizontalAlignment="Left"
77-
VerticalAlignment="Top"
79+
VerticalAlignment="Center"
7880
RenderOptions.BitmapScalingMode="Fant"
7981
Stretch="UniformToFill"
8082
Visibility="Collapsed" />
8183
<TextBlock
8284
x:Name="TitleTextBlock"
8385
Grid.Column="1"
8486
MaxWidth="400"
85-
Margin="26,0,26,0"
87+
Margin="10 0 26 0"
88+
VerticalAlignment="Center"
8689
FontFamily="Segoe UI"
8790
FontSize="20"
8891
FontWeight="SemiBold"
@@ -93,46 +96,46 @@
9396
x:Name="DescTextBlock"
9497
Grid.Column="1"
9598
MaxWidth="400"
96-
Margin="26,0,26,0"
99+
Margin="0 0 26 0"
97100
HorizontalAlignment="Stretch"
98101
FontSize="14"
99102
TextAlignment="Left"
100103
TextWrapping="Wrap" />
101104
</StackPanel>
102105
<Border
103106
Grid.Row="2"
104-
Margin="0,0,0,0"
107+
Margin="0 0 0 0"
105108
Background="{DynamicResource PopupButtonAreaBGColor}"
106109
BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
107-
BorderThickness="0,1,0,0">
110+
BorderThickness="0 1 0 0">
108111
<WrapPanel
109112
HorizontalAlignment="Center"
110113
VerticalAlignment="Center"
111114
Orientation="Horizontal">
112115
<Button
113116
x:Name="btnCancel"
114117
MinWidth="140"
115-
Margin="5,0,5,0"
118+
Margin="5 0 5 0"
116119
Click="Button_Click"
117-
Content="{DynamicResource cancel}" />
120+
Content="{DynamicResource commonCancel}" />
118121
<Button
119122
x:Name="btnNo"
120123
MinWidth="140"
121-
Margin="5,0,5,0"
124+
Margin="5 0 5 0"
122125
Click="Button_Click"
123-
Content="No" />
126+
Content="{DynamicResource commonNo}" />
124127
<Button
125128
x:Name="btnOk"
126129
MinWidth="140"
127-
Margin="5,0,5,0"
130+
Margin="5 0 5 0"
128131
Click="Button_Click"
129-
Content="OK" />
132+
Content="{DynamicResource commonOK}" />
130133
<Button
131134
x:Name="btnYes"
132135
MinWidth="140"
133-
Margin="5,0,5,0"
136+
Margin="5 0 5 0"
134137
Click="Button_Click"
135-
Content="Yes" />
138+
Content="{DynamicResource commonYes}" />
136139
</WrapPanel>
137140
</Border>
138141
</Grid>

Flow.Launcher/MessageBoxEx.xaml.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public enum MessageBoxType
3030
{
3131
ConfirmationWithYesNo = 0,
3232
ConfirmationWithYesNoCancel,
33+
YesNo,
3334
Information,
3435
Error,
3536
Warning
@@ -68,6 +69,9 @@ public static MessageBoxResult Show(string caption, string msg, MessageBoxType t
6869
case MessageBoxType.ConfirmationWithYesNo:
6970
return Show(caption, msg, MessageBoxButton.YesNo,
7071
MessageBoxImage.Question);
72+
case MessageBoxType.YesNo:
73+
return Show(caption, msg, MessageBoxButton.YesNo,
74+
MessageBoxImage.Question);
7175
case MessageBoxType.ConfirmationWithYesNoCancel:
7276
return Show(caption, msg, MessageBoxButton.YesNoCancel,
7377
MessageBoxImage.Question);
@@ -168,7 +172,6 @@ private static void SetImageOfMessageBox(MessageBoxImage image)
168172
}
169173
private void SetImage(string imageName)
170174
{
171-
//string uri = string.Format("/Resources/Images/{0}", imageName);
172175
string uri = Constant.ProgramDirectory + "/Images/" + imageName;
173176
var uriSource = new Uri(uri, UriKind.RelativeOrAbsolute);
174177
Img.Source = new BitmapImage(uriSource);

Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using Flow.Launcher.Infrastructure;
1212
using Flow.Launcher.Infrastructure.UserSettings;
1313
using Flow.Launcher.Plugin;
14+
using static Flow.Launcher.MessageBoxEx;
1415

1516
namespace Flow.Launcher.SettingPages.ViewModels;
1617

@@ -62,10 +63,10 @@ private void OpenWelcomeWindow()
6263
[RelayCommand]
6364
private void AskClearLogFolderConfirmation()
6465
{
65-
var confirmResult = MessageBox.Show(
66+
var confirmResult = MessageBoxEx.Show(
6667
InternationalizationManager.Instance.GetTranslation("clearlogfolderMessage"),
6768
InternationalizationManager.Instance.GetTranslation("clearlogfolder"),
68-
MessageBoxButton.YesNo
69+
MessageBoxType.YesNo
6970
);
7071

7172
if (confirmResult == MessageBoxResult.Yes)

0 commit comments

Comments
 (0)