enhance: hide suggestion popups when window is deactived (#963)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-03-11 20:22:32 +08:00
parent 91c5c96afc
commit fa4d9d24e9
No known key found for this signature in database
2 changed files with 16 additions and 4 deletions

View file

@ -421,8 +421,14 @@
<Popup PlacementTarget="{Binding #TxtSearchCommitsBox}"
Placement="BottomEdgeAlignedLeft"
HorizontalOffset="-8" VerticalAlignment="-8"
IsOpen="{Binding IsSearchCommitSuggestionOpen}">
HorizontalOffset="-8" VerticalAlignment="-8">
<Popup.IsOpen>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<Binding Path="IsSearchCommitSuggestionOpen"/>
<Binding Path="$parent[Window].IsActive"/>
</MultiBinding>
</Popup.IsOpen>
<Border Margin="8" VerticalAlignment="Top" Effect="drop-shadow(0 0 8 #80000000)">
<Border Background="{DynamicResource Brush.Popup}" CornerRadius="4" Padding="4" BorderThickness="0.65" BorderBrush="{DynamicResource Brush.Accent}">
<ListBox x:Name="SearchSuggestionBox"

View file

@ -43,8 +43,14 @@
<Popup PlacementTarget="{Binding #TxtSearchRevisionFiles}"
Placement="BottomEdgeAlignedLeft"
HorizontalOffset="-8" VerticalAlignment="-8"
IsOpen="{Binding RevisionFileSearchSuggestion, Converter={x:Static c:ListConverters.IsNotNullOrEmpty}}">
HorizontalOffset="-8" VerticalAlignment="-8">
<Popup.IsOpen>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<Binding Path="RevisionFileSearchSuggestion" Converter="{x:Static c:ListConverters.IsNotNullOrEmpty}}"/>
<Binding Path="$parent[Window].IsActive"/>
</MultiBinding>
</Popup.IsOpen>
<Border Margin="8" VerticalAlignment="Top" Effect="drop-shadow(0 0 8 #80000000)">
<Border Background="{DynamicResource Brush.Popup}" CornerRadius="4" Padding="4" BorderThickness="0.65" BorderBrush="{DynamicResource Brush.Accent}">
<ListBox x:Name="SearchSuggestionBox"