Skip to content

Commit 9f364d7

Browse files
committed
Adjust Image Visibility
1 parent 298415c commit 9f364d7

File tree

7 files changed

+17
-6
lines changed

7 files changed

+17
-6
lines changed

Flow.Launcher/Images/Error.png

-44.4 KB
Loading

Flow.Launcher/Images/Exclamation.png

-29.4 KB
Loading

Flow.Launcher/Images/Information.png

-45.7 KB
Loading

Flow.Launcher/Images/Question.png

-46.3 KB
Loading

Flow.Launcher/MessageBoxEx.xaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@
7272
Grid.Column="0"
7373
Width="18"
7474
Height="18"
75-
Margin="30,0,10,0"
75+
Margin="30,10,0,0"
7676
HorizontalAlignment="Left"
77+
VerticalAlignment="Top"
78+
RenderOptions.BitmapScalingMode="Fant"
79+
Stretch="UniformToFill"
7780
Visibility="Collapsed" />
7881
<TextBlock
7982
x:Name="TitleTextBlock"
@@ -117,19 +120,19 @@
117120
MinWidth="140"
118121
Margin="5,0,5,0"
119122
Click="Button_Click"
120-
Content="{DynamicResource cancel}" />
123+
Content="No" />
121124
<Button
122125
x:Name="btnOk"
123126
MinWidth="140"
124127
Margin="5,0,5,0"
125128
Click="Button_Click"
126-
Content="{DynamicResource done}" />
129+
Content="OK" />
127130
<Button
128131
x:Name="btnYes"
129132
MinWidth="140"
130133
Margin="5,0,5,0"
131134
Click="Button_Click"
132-
Content="{DynamicResource done}" />
135+
Content="Yes" />
133136
</WrapPanel>
134137
</Border>
135138
</Grid>

Flow.Launcher/MessageBoxEx.xaml.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
using System.Windows.Media.Imaging;
1414
using System.Windows.Shapes;
1515
using Flow.Launcher.Core.Resource;
16+
using Flow.Launcher.Infrastructure;
17+
using Flow.Launcher.Infrastructure.Image;
1618
using YamlDotNet.Core.Tokens;
1719

1820
namespace Flow.Launcher
@@ -145,15 +147,19 @@ private static void SetImageOfMessageBox(MessageBoxImage image)
145147
{
146148
case MessageBoxImage.Warning:
147149
msgBox.SetImage("Warning.png");
150+
msgBox.Img.Visibility = Visibility.Visible;
148151
break;
149152
case MessageBoxImage.Question:
150153
msgBox.SetImage("Question.png");
154+
msgBox.Img.Visibility = Visibility.Visible;
151155
break;
152156
case MessageBoxImage.Information:
153157
msgBox.SetImage("Information.png");
158+
msgBox.Img.Visibility = Visibility.Visible;
154159
break;
155160
case MessageBoxImage.Error:
156161
msgBox.SetImage("Error.png");
162+
msgBox.Img.Visibility = Visibility.Visible;
157163
break;
158164
default:
159165
msgBox.Img.Visibility = Visibility.Collapsed;
@@ -162,7 +168,8 @@ private static void SetImageOfMessageBox(MessageBoxImage image)
162168
}
163169
private void SetImage(string imageName)
164170
{
165-
string uri = string.Format("/Images/{0}", imageName);
171+
//string uri = string.Format("/Resources/Images/{0}", imageName);
172+
string uri = Constant.ProgramDirectory + "/Images/" + imageName;
166173
var uriSource = new Uri(uri, UriKind.RelativeOrAbsolute);
167174
Img.Source = new BitmapImage(uriSource);
168175
}

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
using System.Windows.Interop;
2121
using System.Windows.Media;
2222
using System.Windows.Navigation;
23+
using static Flow.Launcher.MessageBoxEx;
2324
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window;
2425
using Button = System.Windows.Controls.Button;
2526
using Control = System.Windows.Controls.Control;
@@ -280,7 +281,7 @@ private void OpenWelcomeWindow(object sender, RoutedEventArgs e)
280281
}
281282
private void OpenTestBtn(object sender, RoutedEventArgs e)
282283
{
283-
var messageBoxResult = MessageBoxEx.Show("The TitleBarBackground property can be used to set the background for the Title bar. ... The following screen shots illustrate the title bar background changes.", "This is Title Part This is Title Part This is Title Part This is Title Part");
284+
var messageBoxResult = MessageBoxEx.Show("Yes, This is sucks", "MessageBox is bad?", MessageBoxType.ConfirmationWithYesNo);
284285
}
285286
private void OpenLogFolder(object sender, RoutedEventArgs e)
286287
{

0 commit comments

Comments
 (0)