Adjust Image Visibility

This commit is contained in:
DB p 2022-11-14 01:29:24 +09:00
parent 298415cddb
commit 9f364d77a7
7 changed files with 17 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View file

@ -72,8 +72,11 @@
Grid.Column="0"
Width="18"
Height="18"
Margin="30,0,10,0"
Margin="30,10,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
RenderOptions.BitmapScalingMode="Fant"
Stretch="UniformToFill"
Visibility="Collapsed" />
<TextBlock
x:Name="TitleTextBlock"
@ -117,19 +120,19 @@
MinWidth="140"
Margin="5,0,5,0"
Click="Button_Click"
Content="{DynamicResource cancel}" />
Content="No" />
<Button
x:Name="btnOk"
MinWidth="140"
Margin="5,0,5,0"
Click="Button_Click"
Content="{DynamicResource done}" />
Content="OK" />
<Button
x:Name="btnYes"
MinWidth="140"
Margin="5,0,5,0"
Click="Button_Click"
Content="{DynamicResource done}" />
Content="Yes" />
</WrapPanel>
</Border>
</Grid>

View file

@ -13,6 +13,8 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Flow.Launcher.Core.Resource;
using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.Image;
using YamlDotNet.Core.Tokens;
namespace Flow.Launcher
@ -145,15 +147,19 @@ namespace Flow.Launcher
{
case MessageBoxImage.Warning:
msgBox.SetImage("Warning.png");
msgBox.Img.Visibility = Visibility.Visible;
break;
case MessageBoxImage.Question:
msgBox.SetImage("Question.png");
msgBox.Img.Visibility = Visibility.Visible;
break;
case MessageBoxImage.Information:
msgBox.SetImage("Information.png");
msgBox.Img.Visibility = Visibility.Visible;
break;
case MessageBoxImage.Error:
msgBox.SetImage("Error.png");
msgBox.Img.Visibility = Visibility.Visible;
break;
default:
msgBox.Img.Visibility = Visibility.Collapsed;
@ -162,7 +168,8 @@ namespace Flow.Launcher
}
private void SetImage(string imageName)
{
string uri = string.Format("/Images/{0}", imageName);
//string uri = string.Format("/Resources/Images/{0}", imageName);
string uri = Constant.ProgramDirectory + "/Images/" + imageName;
var uriSource = new Uri(uri, UriKind.RelativeOrAbsolute);
Img.Source = new BitmapImage(uriSource);
}

View file

@ -20,6 +20,7 @@ using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Navigation;
using static Flow.Launcher.MessageBoxEx;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window;
using Button = System.Windows.Controls.Button;
using Control = System.Windows.Controls.Control;
@ -280,7 +281,7 @@ namespace Flow.Launcher
}
private void OpenTestBtn(object sender, RoutedEventArgs e)
{
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");
var messageBoxResult = MessageBoxEx.Show("Yes, This is sucks", "MessageBox is bad?", MessageBoxType.ConfirmationWithYesNo);
}
private void OpenLogFolder(object sender, RoutedEventArgs e)
{