✅ 优化搜索结果显示UI
This commit is contained in:
@@ -253,7 +253,7 @@ namespace GeekDesk.Control.Other
|
||||
{
|
||||
EveryThingRuning = true;
|
||||
MainWindow.mainWindow.RightCard.Loading_RightCard.Visibility = Visibility.Visible;
|
||||
string[] split = MainWindow.mainWindow.TotalMsgBtn.Content.ToString().Split(' ');
|
||||
string[] split = MainWindow.mainWindow.SearchResText.Text.Split(' ');
|
||||
long count = Convert.ToInt64(split[0]);
|
||||
|
||||
ObservableCollection<IconInfo> resList = this.DataContext as ObservableCollection<IconInfo>;
|
||||
@@ -264,7 +264,7 @@ namespace GeekDesk.Control.Other
|
||||
this.Dispatcher.Invoke(() =>
|
||||
{
|
||||
count += searchRes.Count;
|
||||
MainWindow.mainWindow.TotalMsgBtn.Content = count + " of " + split[split.Length - 1];
|
||||
MainWindow.mainWindow.SearchResText.Text = count + " of " + split[split.Length - 1];
|
||||
foreach (IconInfo info in searchRes)
|
||||
{
|
||||
resList.Add(info);
|
||||
|
||||
@@ -142,16 +142,16 @@
|
||||
<!--分割线-->
|
||||
<GridSplitter Opacity="0" Grid.Row="1" Grid.Column="0" Width="1" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
|
||||
|
||||
<Button x:Name="TotalMsgBtn" Panel.ZIndex="2"
|
||||
Visibility="Hidden"
|
||||
<Border x:Name="SearchResContainer" Panel.ZIndex="2"
|
||||
Visibility="Collapsed"
|
||||
Grid.Row="1" Grid.Column="1"
|
||||
HorizontalAlignment="Right" MaxWidth="200"
|
||||
VerticalAlignment="Top"
|
||||
VerticalAlignment="Top"
|
||||
CornerRadius="8"
|
||||
Margin="0,20,40,0"
|
||||
>
|
||||
<Button.Content>0 of 0</Button.Content>
|
||||
<Button.Style>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource Btn1}">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border" >
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="White" Opacity="0.6"/>
|
||||
@@ -159,8 +159,9 @@
|
||||
</Setter>
|
||||
<Setter Property="MaxWidth" Value="300"/>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
</Border.Style>
|
||||
<TextBlock Margin="8" FontSize="13" x:Name="SearchResText" Text="0 of 0" Opacity="0.6"/>
|
||||
</Border>
|
||||
|
||||
<!--搜索输入框-->
|
||||
<TextBox Panel.ZIndex="2" Grid.Row="0" Grid.Column="1"
|
||||
|
||||
@@ -133,6 +133,7 @@ namespace GeekDesk
|
||||
RunTimeStatus.EVERYTHING_NEW_SEARCH = true;
|
||||
//显示搜索结果列表
|
||||
RightCard.VisibilitySearchCard(Visibility.Visible);
|
||||
SearchResContainer.Visibility = Visibility.Collapsed;
|
||||
object obj = RightCard.VerticalCard.Content;
|
||||
if (obj != null)
|
||||
{
|
||||
@@ -168,7 +169,6 @@ namespace GeekDesk
|
||||
}
|
||||
RunTimeStatus.EVERYTHING_NEW_SEARCH = false;
|
||||
|
||||
|
||||
this.Dispatcher.Invoke(() =>
|
||||
{
|
||||
string inputText = SearchBox.Text.ToLower().Trim();
|
||||
@@ -179,7 +179,7 @@ namespace GeekDesk
|
||||
|
||||
if (appData.AppConfig.EnableEveryThing == true)
|
||||
{
|
||||
ObservableCollection<IconInfo> iconBakList = EveryThingUtil.Search(inputText);
|
||||
ObservableCollection<IconInfo> iconBakList = EveryThingUtil.Search(inputText);
|
||||
foreach (IconInfo icon in iconBakList)
|
||||
{
|
||||
resList.Add(icon);
|
||||
@@ -206,7 +206,8 @@ namespace GeekDesk
|
||||
{
|
||||
if (appData.AppConfig.EnableEveryThing == true)
|
||||
{
|
||||
TotalMsgBtn.Visibility = Visibility.Visible;
|
||||
SearchResText.Text = resList.Count + " of " + Convert.ToInt32(EveryThingUtil.Everything_GetNumResults());
|
||||
SearchResContainer.Visibility = Visibility.Visible;
|
||||
}
|
||||
SearchResControl control = new SearchResControl(resList);
|
||||
RightCard.VerticalCard.Content = control;
|
||||
@@ -337,8 +338,8 @@ namespace GeekDesk
|
||||
SearchBox.Clear();
|
||||
SearchBox.TextChanged += SearchBox_TextChanged;
|
||||
SearchBox.Width = 0;
|
||||
TotalMsgBtn.Content = "0 of 0";
|
||||
TotalMsgBtn.Visibility = Visibility.Hidden;
|
||||
SearchResText.Text = "0 of 0";
|
||||
SearchResContainer.Visibility = Visibility.Collapsed;
|
||||
RightCard.VerticalCard.Content = null;
|
||||
RightCard.VisibilitySearchCard(Visibility.Collapsed);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user