Skip to content

Commit ab4f78f

Browse files
committed
Explorer plugin native context menu: some code simplifications
1 parent c42fbfd commit ab4f78f

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

Flow.Launcher/ResultListBox.xaml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -223,26 +223,11 @@
223223
<ListBox.ItemContainerStyle>
224224
<Style TargetType="{x:Type ListBoxItem}">
225225
<Style.Triggers>
226-
<!-- Condition for Type being 'Small' -->
227-
<MultiDataTrigger>
228-
<MultiDataTrigger.Conditions>
229-
<Condition Binding="{Binding Result.ItemType}" Value="Small" />
230-
</MultiDataTrigger.Conditions>
231-
<MultiDataTrigger.Setters>
232-
<Setter Property="Height" Value="{Binding SmallSize}" />
233-
</MultiDataTrigger.Setters>
234-
</MultiDataTrigger>
235-
<!-- Default condition for Type being other values or not set -->
236-
<DataTrigger Binding="{Binding Result.ItemType}" Value="{x:Null}">
237-
<Setter Property="Height" Value="{Binding Settings.ItemHeightSize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
238-
</DataTrigger>
239-
<DataTrigger Binding="{Binding Result.ItemType}" Value="">
240-
<Setter Property="Height" Value="{Binding Settings.ItemHeightSize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
241-
</DataTrigger>
242-
<DataTrigger Binding="{Binding Result.ItemType}" Value="author">
243-
<Setter Property="Height" Value="{Binding Settings.ItemHeightSize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
226+
<DataTrigger Binding="{Binding Result.ItemType}" Value="Small">
227+
<Setter Property="Height" Value="{Binding SmallSize}" />
244228
</DataTrigger>
245229
</Style.Triggers>
230+
<Setter Property="Height" Value="{Binding Settings.ItemHeightSize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
246231
<Setter Property="Visibility" Value="Visible" />
247232
<EventSetter Event="MouseEnter" Handler="OnMouseEnter" />
248233
<EventSetter Event="MouseMove" Handler="OnMouseMove" />
@@ -279,4 +264,4 @@
279264
</Style>
280265

281266
</ListBox.ItemContainerStyle>
282-
</ListBox>
267+
</ListBox>

Flow.Launcher/ViewModel/ResultViewModel.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,7 @@ public ImageSource PreviewImage
180180
/// </summary>
181181
public bool UseBigThumbnail => Result.Preview.IsMedia;
182182

183-
public double SmallSize
184-
{
185-
get { return Settings.ItemHeightSize * 0.6; }
186-
}
183+
public double SmallSize => Settings.ItemHeightSize * 0.6;
187184

188185
public GlyphInfo Glyph { get; set; }
189186

0 commit comments

Comments
 (0)