mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
feat: New option to show executed results in settings
This commit is contained in:
parent
8bac530504
commit
3cc4f13f4d
4 changed files with 59 additions and 9 deletions
|
|
@ -230,6 +230,21 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private bool _showHistoryExecutedResultsForHomePage = false;
|
||||
public bool ShowHistoryExecutedResultsForHomePage
|
||||
{
|
||||
get => _showHistoryExecutedResultsForHomePage;
|
||||
set
|
||||
{
|
||||
if (_showHistoryExecutedResultsForHomePage != value)
|
||||
{
|
||||
_showHistoryExecutedResultsForHomePage = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int MaxHistoryResultsToShowForHomePage { get; set; } = 5;
|
||||
|
||||
public bool AutoRestartAfterChanging { get; set; } = false;
|
||||
|
|
|
|||
|
|
@ -165,6 +165,7 @@
|
|||
<system:String x:Key="homePage">Home Page</system:String>
|
||||
<system:String x:Key="homePageToolTip">Show home page results when query text is empty.</system:String>
|
||||
<system:String x:Key="historyResultsForHomePage">Show History Results in Home Page</system:String>
|
||||
<system:String x:Key="historyExecutedResultsForHomePage">Show History Executed Results in Home Page</system:String>
|
||||
<system:String x:Key="historyResultsCountForHomePage">Maximum History Results Shown in Home Page</system:String>
|
||||
<system:String x:Key="homeToggleBoxToolTip">This can only be edited if plugin supports Home feature and Home Page is enabled.</system:String>
|
||||
<system:String x:Key="showAtTopmost">Show Search Window at Foremost</system:String>
|
||||
|
|
|
|||
|
|
@ -381,18 +381,31 @@
|
|||
OnContent="{DynamicResource enable}" />
|
||||
</cc:ExCard.SideContent>
|
||||
<cc:Card Title="{DynamicResource historyResultsCountForHomePage}" Type="InsideFit">
|
||||
<ui:NumberBox
|
||||
Width="120"
|
||||
Margin="0 0 0 0"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
SmallChange="5"
|
||||
SpinButtonPlacementMode="Compact"
|
||||
ValidationMode="InvalidInputOverwritten"
|
||||
Value="{Binding MaxHistoryResultsToShowValue}" />
|
||||
<StackPanel Orientation="Vertical">
|
||||
<ui:NumberBox
|
||||
Width="120"
|
||||
Margin="0 0 0 0"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
SmallChange="5"
|
||||
SpinButtonPlacementMode="Compact"
|
||||
ValidationMode="InvalidInputOverwritten"
|
||||
Value="{Binding MaxHistoryResultsToShowValue}" />
|
||||
</StackPanel>
|
||||
</cc:Card>
|
||||
</cc:ExCard>
|
||||
|
||||
<cc:Card
|
||||
Title="{DynamicResource historyExecutedResultsForHomePage}"
|
||||
Margin="0 14 0 0"
|
||||
Icon=""
|
||||
Sub="{DynamicResource homePageToolTip}">
|
||||
<ui:ToggleSwitch
|
||||
IsOn="{Binding Settings.ShowHistoryExecutedResultsForHomePage}"
|
||||
OffContent="{DynamicResource disable}"
|
||||
OnContent="{DynamicResource enable}" />
|
||||
</cc:Card>
|
||||
|
||||
<cc:Card
|
||||
Title="{DynamicResource defaultFileManager}"
|
||||
Margin="0 14 0 0"
|
||||
|
|
|
|||
21
Flow.Launcher/Storage/ExecutedHistory.cs
Normal file
21
Flow.Launcher/Storage/ExecutedHistory.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
using Flow.Launcher.Plugin;
|
||||
|
||||
namespace Flow.Launcher.Storage;
|
||||
public class ExecutedHistory
|
||||
{
|
||||
[JsonInclude]
|
||||
public List<Result> Items { get; private set; } = new List<Result>();
|
||||
private int _maxHistory = 300;
|
||||
|
||||
public void Add(Result result)
|
||||
{
|
||||
Items.Add(result);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in a new issue