mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #3867 from Flow-Launcher/preview_panel_creation
Do not create customized preview panel when preview is off
This commit is contained in:
commit
908ed0cff5
3 changed files with 8 additions and 5 deletions
|
|
@ -534,10 +534,8 @@
|
|||
MinHeight="380"
|
||||
MaxHeight="{Binding ElementName=ResultListBox, Path=ActualHeight}"
|
||||
Padding="0 0 10 10"
|
||||
d:DataContext="{d:DesignInstance vm:ResultViewModel}"
|
||||
DataContext="{Binding PreviewSelectedItem, Mode=OneWay}"
|
||||
Visibility="{Binding ShowCustomizedPreview}">
|
||||
<ContentControl Content="{Binding Result.PreviewPanel.Value}" />
|
||||
<ContentControl Content="{Binding CustomizedPreviewControl}" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ using System.Threading.Channels;
|
|||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Threading;
|
||||
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||
|
|
@ -883,6 +884,12 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
public Visibility ShowCustomizedPreview
|
||||
=> InternalPreviewVisible && PreviewSelectedItem?.Result.PreviewPanel != null ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
||||
public UserControl CustomizedPreviewControl
|
||||
=> ShowCustomizedPreview == Visibility.Visible ? PreviewSelectedItem?.Result.PreviewPanel.Value : null;
|
||||
|
||||
public Visibility ProgressBarVisibility { get; set; }
|
||||
public Visibility MainWindowVisibility { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -66,8 +66,6 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
public Visibility ShowDefaultPreview => Result.PreviewPanel == null ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
||||
public Visibility ShowCustomizedPreview => Result.PreviewPanel == null ? Visibility.Collapsed : Visibility.Visible;
|
||||
|
||||
public Visibility ShowIcon
|
||||
{
|
||||
get
|
||||
|
|
|
|||
Loading…
Reference in a new issue