mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Limit the display result item to 6 at most.
This commit is contained in:
parent
6c17107f39
commit
288b46947d
2 changed files with 10 additions and 1 deletions
|
|
@ -11,7 +11,8 @@
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
|
|
||||||
<Grid x:Name="gridContainer">
|
<Grid x:Name="gridContainer">
|
||||||
<ListBox x:Name="lbResults" PreviewMouseDown="LbResults_OnPreviewMouseDown" Style="{DynamicResource BaseListboxStyle}" SelectionChanged ="lbResults_SelectionChanged" Focusable="False" KeyboardNavigation.DirectionalNavigation="Cycle" SelectionMode="Single" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard">
|
<!-- set max height of listbox to allow 6 results showed at once -->
|
||||||
|
<ListBox x:Name="lbResults" MaxHeight="300" PreviewMouseDown="LbResults_OnPreviewMouseDown" Style="{DynamicResource BaseListboxStyle}" SelectionChanged ="lbResults_SelectionChanged" Focusable="False" KeyboardNavigation.DirectionalNavigation="Cycle" SelectionMode="Single" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard">
|
||||||
<ListBox.Resources>
|
<ListBox.Resources>
|
||||||
<!--SelectedItem with focus-->
|
<!--SelectedItem with focus-->
|
||||||
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="{DynamicResource ItemSelectedBackgroundColor}"/>
|
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="{DynamicResource ItemSelectedBackgroundColor}"/>
|
||||||
|
|
@ -20,6 +21,7 @@
|
||||||
</ListBox.Resources>
|
</ListBox.Resources>
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
|
<!-- a result item height is 50 including margin -->
|
||||||
<Grid HorizontalAlignment="Stretch" Height="40" VerticalAlignment="Stretch" Margin="5" Cursor="Hand">
|
<Grid HorizontalAlignment="Stretch" Height="40" VerticalAlignment="Stretch" Margin="5" Cursor="Hand">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="32"></ColumnDefinition>
|
<ColumnDefinition Width="32"></ColumnDefinition>
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ using System.Windows.Controls;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Animation;
|
||||||
using Wox.Helper;
|
using Wox.Helper;
|
||||||
using Wox.Infrastructure;
|
using Wox.Infrastructure;
|
||||||
using Wox.Plugin;
|
using Wox.Plugin;
|
||||||
|
|
@ -42,6 +43,12 @@ namespace Wox
|
||||||
SelectFirst();
|
SelectFirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AnimateListBoxResultChange()
|
||||||
|
{
|
||||||
|
//todo:
|
||||||
|
var da = new DoubleAnimation(lbResults.ActualHeight, ActualWidth + 100, new Duration(new TimeSpan(0, 0, 0, 0, 1600)));
|
||||||
|
}
|
||||||
|
|
||||||
private int GetInsertLocation(int currentScore)
|
private int GetInsertLocation(int currentScore)
|
||||||
{
|
{
|
||||||
int location = lbResults.Items.Count;
|
int location = lbResults.Items.Count;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue