Add ui in general page

This commit is contained in:
Jack251970 2025-05-03 18:17:07 +08:00
parent e9ef26a8dd
commit e8333331b0
3 changed files with 57 additions and 13 deletions

View file

@ -126,6 +126,10 @@
<system:String x:Key="KoreanImeOpenLinkButton">Open</system:String>
<system:String x:Key="KoreanImeRegistry">Use Previous Korean IME</system:String>
<system:String x:Key="KoreanImeRegistryTooltip">You can change the Previous Korean IME settings directly from here</system:String>
<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="historyResultsCountForHomePage">Maximum History Results Shown in Home Page</system:String>
<!-- Setting Plugin -->
<system:String x:Key="searchplugin">Search Plugin</system:String>

View file

@ -154,11 +154,22 @@ public partial class SettingsPaneGeneralViewModel : BaseModel
{
Settings.SearchDelayTime = value;
OnPropertyChanged();
OnPropertyChanged(nameof(SearchDelayTimeDisplay));
}
}
}
public string SearchDelayTimeDisplay => $"{SearchDelayTimeValue}ms";
public int MaxHistoryResultsToShowValue
{
get => Settings.MaxHistoryResultsToShowForHomePage;
set
{
if (Settings.MaxHistoryResultsToShowForHomePage != value)
{
Settings.MaxHistoryResultsToShowForHomePage = value;
OnPropertyChanged();
}
}
}
private void UpdateEnumDropdownLocalizations()
{

View file

@ -217,17 +217,46 @@
Title="{DynamicResource searchDelayTime}"
Sub="{DynamicResource searchDelayTimeToolTip}"
Type="InsideFit">
<StackPanel Orientation="Horizontal">
<ui:NumberBox
Width="120"
Margin="0 0 0 0"
Maximum="1000"
Minimum="0"
SmallChange="10"
SpinButtonPlacementMode="Compact"
ValidationMode="InvalidInputOverwritten"
Value="{Binding SearchDelayTimeValue}" />
</StackPanel>
<ui:NumberBox
Width="120"
Margin="0 0 0 0"
Maximum="1000"
Minimum="0"
SmallChange="10"
SpinButtonPlacementMode="Compact"
ValidationMode="InvalidInputOverwritten"
Value="{Binding SearchDelayTimeValue}" />
</cc:Card>
</cc:ExCard>
<cc:Card
Title="{DynamicResource homePage}"
Margin="0 14 0 0"
Icon="&#xE80F;"
Sub="{DynamicResource homePageToolTip}">
<ui:ToggleSwitch
IsOn="{Binding Settings.ShowHomePage}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</cc:Card>
<cc:ExCard Title="{DynamicResource historyResultsForHomePage}" Icon="&#xE81C;">
<cc:ExCard.SideContent>
<ui:ToggleSwitch
IsOn="{Binding Settings.ShowHistoryResultsForHomePage}"
OffContent="{DynamicResource disable}"
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}" />
</cc:Card>
</cc:ExCard>