mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix Separator Trigger
Fix Resized trigger When Window Move
This commit is contained in:
parent
852dcc7723
commit
de8c8bde76
2 changed files with 30 additions and 5 deletions
|
|
@ -344,8 +344,22 @@
|
||||||
<ContentControl>
|
<ContentControl>
|
||||||
<ContentControl.Style>
|
<ContentControl.Style>
|
||||||
<Style TargetType="ContentControl">
|
<Style TargetType="ContentControl">
|
||||||
<Setter Property="Visibility" Value="Collapsed" />
|
<Setter Property="Visibility" Value="Visible" />
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
|
<MultiDataTrigger>
|
||||||
|
<MultiDataTrigger.Conditions>
|
||||||
|
<Condition Binding="{Binding ElementName=ResultListBox, Path=Items.Count}" Value="0" />
|
||||||
|
<Condition Binding="{Binding ElementName=ContextMenu, Path=Visibility}" Value="Collapsed" />
|
||||||
|
<Condition Binding="{Binding ElementName=History, Path=Visibility}" Value="Collapsed" />
|
||||||
|
</MultiDataTrigger.Conditions>
|
||||||
|
<MultiDataTrigger.Setters>
|
||||||
|
<Setter Property="Visibility" Value="Collapsed" />
|
||||||
|
<Setter Property="Margin" Value="0" />
|
||||||
|
<Setter Property="Height" Value="0" />
|
||||||
|
</MultiDataTrigger.Setters>
|
||||||
|
</MultiDataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
<!--<Style.Triggers>
|
||||||
<DataTrigger Binding="{Binding ElementName=ResultListBox, Path=Visibility}" Value="Visible">
|
<DataTrigger Binding="{Binding ElementName=ResultListBox, Path=Visibility}" Value="Visible">
|
||||||
<Setter Property="Visibility" Value="Visible" />
|
<Setter Property="Visibility" Value="Visible" />
|
||||||
</DataTrigger>
|
</DataTrigger>
|
||||||
|
|
@ -355,7 +369,7 @@
|
||||||
<DataTrigger Binding="{Binding ElementName=History, Path=Visibility}" Value="Visible">
|
<DataTrigger Binding="{Binding ElementName=History, Path=Visibility}" Value="Visible">
|
||||||
<Setter Property="Visibility" Value="Visible" />
|
<Setter Property="Visibility" Value="Visible" />
|
||||||
</DataTrigger>
|
</DataTrigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>-->
|
||||||
</Style>
|
</Style>
|
||||||
</ContentControl.Style>
|
</ContentControl.Style>
|
||||||
<Rectangle
|
<Rectangle
|
||||||
|
|
@ -428,6 +442,7 @@
|
||||||
<GridSplitter
|
<GridSplitter
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="{Binding PreviewVisible, Converter={StaticResource SplitterConverter}}"
|
Width="{Binding PreviewVisible, Converter={StaticResource SplitterConverter}}"
|
||||||
|
Margin="0"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
|
|
|
||||||
|
|
@ -85,15 +85,26 @@ namespace Flow.Launcher
|
||||||
|
|
||||||
private const int WM_ENTERSIZEMOVE = 0x0231;
|
private const int WM_ENTERSIZEMOVE = 0x0231;
|
||||||
private const int WM_EXITSIZEMOVE = 0x0232;
|
private const int WM_EXITSIZEMOVE = 0x0232;
|
||||||
|
private int _initialWidth;
|
||||||
|
private int _initialHeight;
|
||||||
private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
|
private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
|
||||||
{
|
{
|
||||||
if (msg == WM_ENTERSIZEMOVE)
|
if (msg == WM_ENTERSIZEMOVE)
|
||||||
{
|
{
|
||||||
|
_initialWidth = (int)Width;
|
||||||
|
_initialHeight = (int)Height;
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
if (msg == WM_EXITSIZEMOVE)
|
if (msg == WM_EXITSIZEMOVE)
|
||||||
{
|
{
|
||||||
OnResizeEnd();
|
if ( _initialHeight != (int)Height)
|
||||||
|
{
|
||||||
|
OnResizeEnd();
|
||||||
|
}
|
||||||
|
if (_initialWidth != (int)Width)
|
||||||
|
{
|
||||||
|
FlowMainWindow.SizeToContent = SizeToContent.Height;
|
||||||
|
}
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
return IntPtr.Zero;
|
return IntPtr.Zero;
|
||||||
|
|
@ -120,9 +131,8 @@ namespace Flow.Launcher
|
||||||
_settings.MaxResultsToShow = Convert.ToInt32(Math.Truncate(itemCount));
|
_settings.MaxResultsToShow = Convert.ToInt32(Math.Truncate(itemCount));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_viewModel.MainWindowWidth = Width;
|
|
||||||
FlowMainWindow.SizeToContent = SizeToContent.Height;
|
FlowMainWindow.SizeToContent = SizeToContent.Height;
|
||||||
|
_viewModel.MainWindowWidth = Width;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCopy(object sender, ExecutedRoutedEventArgs e)
|
private void OnCopy(object sender, ExecutedRoutedEventArgs e)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue