diff --git a/Flow.Launcher.Plugin/Result.cs b/Flow.Launcher.Plugin/Result.cs index 7451d29c7..b51288fe3 100644 --- a/Flow.Launcher.Plugin/Result.cs +++ b/Flow.Launcher.Plugin/Result.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Threading.Tasks; +using System.Windows.Controls; using System.Windows.Media; namespace Flow.Launcher.Plugin @@ -193,6 +194,11 @@ namespace Flow.Launcher.Plugin /// public string SubTitleToolTip { get; set; } + /// + /// Customized Preview Panel + /// + public Lazy PreviewPanel { get; set; } + /// /// Run this result, asynchronously /// diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 2126c4906..54c577f84 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -12,7 +12,6 @@ Title="Flow Launcher" MinWidth="{Binding MainWindowWidth, Mode=OneWay}" MaxWidth="{Binding MainWindowWidth, Mode=OneWay}" - d:DataContext="{d:DesignInstance vm:MainViewModel}" AllowDrop="True" AllowsTransparency="True" Background="Transparent" @@ -235,9 +234,10 @@ + Width="Auto" + HorizontalAlignment="Stretch" + Style="{DynamicResource SeparatorStyle}" + Visibility="Visible" /> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index 1e6ee2b92..372fb40e5 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -15,7 +15,7 @@ namespace Flow.Launcher.ViewModel public class ResultViewModel : BaseModel { private static PrivateFontCollection fontCollection = new(); - private static Dictionary fonts = new(); + private static Dictionary fonts = new(); public ResultViewModel(Result result, Settings settings) { @@ -67,6 +67,10 @@ namespace Flow.Launcher.ViewModel public Visibility ShowOpenResultHotkey => Settings.ShowOpenResultHotkey ? Visibility.Visible : Visibility.Collapsed; + public Visibility ShowDefaultPreview => Result.PreviewPanel == null ? Visibility.Visible : Visibility.Collapsed; + + public Visibility ShowCustomizedPrewview => Result.PreviewPanel == null ? Visibility.Collapsed : Visibility.Visible; + public Visibility ShowIcon { get diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs index 6a8b232e9..812bb01a0 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs @@ -17,6 +17,7 @@ using System.Diagnostics; using Stopwatch = Flow.Launcher.Infrastructure.Stopwatch; using System.Diagnostics.CodeAnalysis; using System.Threading.Channels; +using System.Windows.Controls; namespace Flow.Launcher.Plugin.Program.Programs { @@ -104,6 +105,15 @@ namespace Flow.Launcher.Plugin.Program.Programs Score = matchResult.Score, TitleHighlightData = matchResult.MatchData, ContextData = this, + PreviewPanel = new Lazy(() => + { + var control = new UserControl(); + control.Content = new TextBlock() + { + Text = "test" + }; + return control; + }), Action = c => { var runAsAdmin = (