Skip to content

Commit fa4d9d2

Browse files
committed
enhance: hide suggestion popups when window is deactived (#963)
Signed-off-by: leo <longshuang@msn.cn>
1 parent 91c5c96 commit fa4d9d2

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/Views/Repository.axaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,14 @@
421421

422422
<Popup PlacementTarget="{Binding #TxtSearchCommitsBox}"
423423
Placement="BottomEdgeAlignedLeft"
424-
HorizontalOffset="-8" VerticalAlignment="-8"
425-
IsOpen="{Binding IsSearchCommitSuggestionOpen}">
424+
HorizontalOffset="-8" VerticalAlignment="-8">
425+
<Popup.IsOpen>
426+
<MultiBinding Converter="{x:Static BoolConverters.And}">
427+
<Binding Path="IsSearchCommitSuggestionOpen"/>
428+
<Binding Path="$parent[Window].IsActive"/>
429+
</MultiBinding>
430+
</Popup.IsOpen>
431+
426432
<Border Margin="8" VerticalAlignment="Top" Effect="drop-shadow(0 0 8 #80000000)">
427433
<Border Background="{DynamicResource Brush.Popup}" CornerRadius="4" Padding="4" BorderThickness="0.65" BorderBrush="{DynamicResource Brush.Accent}">
428434
<ListBox x:Name="SearchSuggestionBox"

src/Views/RevisionFiles.axaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,14 @@
4343

4444
<Popup PlacementTarget="{Binding #TxtSearchRevisionFiles}"
4545
Placement="BottomEdgeAlignedLeft"
46-
HorizontalOffset="-8" VerticalAlignment="-8"
47-
IsOpen="{Binding RevisionFileSearchSuggestion, Converter={x:Static c:ListConverters.IsNotNullOrEmpty}}">
46+
HorizontalOffset="-8" VerticalAlignment="-8">
47+
<Popup.IsOpen>
48+
<MultiBinding Converter="{x:Static BoolConverters.And}">
49+
<Binding Path="RevisionFileSearchSuggestion" Converter="{x:Static c:ListConverters.IsNotNullOrEmpty}}"/>
50+
<Binding Path="$parent[Window].IsActive"/>
51+
</MultiBinding>
52+
</Popup.IsOpen>
53+
4854
<Border Margin="8" VerticalAlignment="Top" Effect="drop-shadow(0 0 8 #80000000)">
4955
<Border Background="{DynamicResource Brush.Popup}" CornerRadius="4" Padding="4" BorderThickness="0.65" BorderBrush="{DynamicResource Brush.Accent}">
5056
<ListBox x:Name="SearchSuggestionBox"

0 commit comments

Comments
 (0)