Skip to content

Commit d49fbd8

Browse files
authored
Merge pull request #2354 from onesounds/FixPreviewDragLine
Fix the issue resizable while preview turned off
2 parents ab97189 + 1f5505c commit d49fbd8

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

Flow.Launcher/Converters/BoolToVisibilityConverter.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,38 @@ public object Convert(object value, System.Type targetType, object parameter, Cu
3434

3535
public object ConvertBack(object value, System.Type targetType, object parameter, CultureInfo culture) => throw new System.InvalidOperationException();
3636
}
37+
38+
public class SplitterConverter : IValueConverter
39+
/* Prevents the dragging part of the preview area from working when preview is turned off. */
40+
{
41+
public object Convert(object value, System.Type targetType, object parameter, CultureInfo culture)
42+
{
43+
if (parameter != null)
44+
{
45+
if (value is true)
46+
{
47+
return 0;
48+
}
49+
50+
else
51+
{
52+
return 5;
53+
}
54+
}
55+
else
56+
{
57+
if (value is true)
58+
{
59+
return 5;
60+
}
61+
62+
else
63+
{
64+
return 0;
65+
}
66+
}
67+
}
68+
69+
public object ConvertBack(object value, System.Type targetType, object parameter, CultureInfo culture) => throw new System.InvalidOperationException();
70+
}
3771
}

Flow.Launcher/MainWindow.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<converters:QuerySuggestionBoxConverter x:Key="QuerySuggestionBoxConverter" />
3939
<converters:BorderClipConverter x:Key="BorderClipConverter" />
4040
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
41+
<converters:SplitterConverter x:Key="SplitterConverter" />
4142
<converters:BoolToIMEConversionModeConverter x:Key="BoolToIMEConversionModeConverter" />
4243
<converters:BoolToIMEStateConverter x:Key="BoolToIMEStateConverter" />
4344
<converters:StringToKeyBindingConverter x:Key="StringToKeyBindingConverter" />
@@ -398,7 +399,7 @@
398399
</StackPanel>
399400
<GridSplitter
400401
Grid.Column="1"
401-
Width="5"
402+
Width="{Binding PreviewVisible, Converter={StaticResource SplitterConverter}}"
402403
HorizontalAlignment="Center"
403404
VerticalAlignment="Stretch"
404405
Background="Transparent"

0 commit comments

Comments
 (0)