Merge pull request #2354 from onesounds/FixPreviewDragLine

Fix the issue resizable while preview turned off
This commit is contained in:
DB P 2023-09-21 14:30:44 +09:00 committed by GitHub
commit d49fbd8f20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 1 deletions

View file

@ -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();
}
}

View file

@ -38,6 +38,7 @@
<converters:QuerySuggestionBoxConverter x:Key="QuerySuggestionBoxConverter" />
<converters:BorderClipConverter x:Key="BorderClipConverter" />
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
<converters:SplitterConverter x:Key="SplitterConverter" />
<converters:BoolToIMEConversionModeConverter x:Key="BoolToIMEConversionModeConverter" />
<converters:BoolToIMEStateConverter x:Key="BoolToIMEStateConverter" />
<converters:StringToKeyBindingConverter x:Key="StringToKeyBindingConverter" />
@ -398,7 +399,7 @@
</StackPanel>
<GridSplitter
Grid.Column="1"
Width="5"
Width="{Binding PreviewVisible, Converter={StaticResource SplitterConverter}}"
HorizontalAlignment="Center"
VerticalAlignment="Stretch"
Background="Transparent"