mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Use Visibility for consistency
This commit is contained in:
parent
e83e21dddb
commit
62821d37dd
3 changed files with 7 additions and 16 deletions
|
|
@ -438,7 +438,7 @@
|
|||
HorizontalAlignment="Center"
|
||||
Source="{Binding PreviewImage}"
|
||||
StretchDirection="DownOnly"
|
||||
Visibility="{Binding ShowPreviewImage, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
Visibility="{Binding ShowPreviewImage}">
|
||||
<Image.Style>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Setter Property="MaxWidth" Value="96" />
|
||||
|
|
|
|||
|
|
@ -90,26 +90,18 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
public bool ShowPreviewImage
|
||||
public Visibility ShowPreviewImage
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Result.Preview.PreviewImagePath) || Result.Preview.PreviewDelegate != null)
|
||||
if (PreviewImageAvailable)
|
||||
{
|
||||
return true;
|
||||
return Visibility.Visible;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fall back to Icon
|
||||
if (!ImgIconAvailable && !GlyphAvailable)
|
||||
return true;
|
||||
|
||||
// Although user can choose to use glyph icons, plugins may choose to supply only image icons.
|
||||
// In this case we ignore the setting because otherwise icons will not display as intended
|
||||
if (Settings.UseGlyphIcons && !GlyphAvailable && ImgIconAvailable)
|
||||
return true;
|
||||
|
||||
return !Settings.UseGlyphIcons && ImgIconAvailable;
|
||||
// Fall back to icon
|
||||
return ShowIcon;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -244,7 +236,7 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
if (ShowDefaultPreview == Visibility.Visible)
|
||||
{
|
||||
if (!PreviewImageLoaded && ShowPreviewImage)
|
||||
if (!PreviewImageLoaded && ShowPreviewImage == Visibility.Visible)
|
||||
{
|
||||
PreviewImageLoaded = true;
|
||||
_ = LoadPreviewImageAsync();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ using System.Windows.Controls;
|
|||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Flow.Launcher.ViewModel
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue