From 1f5505cad8c53d78a71e4613a4fbc326fe9b02b5 Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 19 Sep 2023 15:57:32 +0900 Subject: [PATCH] Fix an issue where the preview area is resizable even when preview is off. --- .../Converters/BoolToVisibilityConverter.cs | 34 +++++++++++++++++++ Flow.Launcher/MainWindow.xaml | 3 +- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher/Converters/BoolToVisibilityConverter.cs b/Flow.Launcher/Converters/BoolToVisibilityConverter.cs index e60e26be4..627937c7f 100644 --- a/Flow.Launcher/Converters/BoolToVisibilityConverter.cs +++ b/Flow.Launcher/Converters/BoolToVisibilityConverter.cs @@ -34,4 +34,38 @@ namespace Flow.Launcher.Converters public object ConvertBack(object value, System.Type targetType, object parameter, CultureInfo culture) => throw new System.InvalidOperationException(); } + + public class SplitterConverter : IValueConverter + /* Prevents the dragging part of the preview area from working when preview is turned off. */ + { + public object Convert(object value, System.Type targetType, object parameter, CultureInfo culture) + { + if (parameter != null) + { + if (value is true) + { + return 0; + } + + else + { + return 5; + } + } + else + { + if (value is true) + { + return 5; + } + + else + { + return 0; + } + } + } + + public object ConvertBack(object value, System.Type targetType, object parameter, CultureInfo culture) => throw new System.InvalidOperationException(); + } } diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index f864815e4..88e95aa69 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -38,6 +38,7 @@ + @@ -398,7 +399,7 @@