mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix possible convert issue
This commit is contained in:
parent
590b4c82d2
commit
4c46e16160
4 changed files with 19 additions and 4 deletions
|
|
@ -51,6 +51,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Do not include it in the build files -->
|
||||
<PackageReference Include="iNKORE.UI.WPF.Modern" Version="0.10.2.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
|
|
|||
|
|
@ -211,10 +211,13 @@ namespace Flow.Launcher.Plugin.WebSearch
|
|||
get => maxSuggestions;
|
||||
set
|
||||
{
|
||||
if (maxSuggestions != value)
|
||||
if (value > 0 && value <= 1000)
|
||||
{
|
||||
maxSuggestions = value;
|
||||
OnPropertyChanged();
|
||||
if (maxSuggestions != value)
|
||||
{
|
||||
maxSuggestions = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,7 +167,8 @@
|
|||
SmallChange="10"
|
||||
SpinButtonPlacementMode="Compact"
|
||||
ValidationMode="InvalidInputOverwritten"
|
||||
Value="{Binding Settings.MaxSuggestions, Mode=TwoWay}" />
|
||||
ValueChanged="NumberBox_ValueChanged"
|
||||
Value="{Binding Settings.MaxSuggestions, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
|
|
|
|||
|
|
@ -240,5 +240,15 @@ namespace Flow.Launcher.Plugin.WebSearch
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// This is used for NumberBox to force its value to be 1 when the user clears the value
|
||||
private void NumberBox_ValueChanged(iNKORE.UI.WPF.Modern.Controls.NumberBox sender, iNKORE.UI.WPF.Modern.Controls.NumberBoxValueChangedEventArgs args)
|
||||
{
|
||||
if (double.IsNaN(args.NewValue))
|
||||
{
|
||||
sender.Value = 1;
|
||||
_settings.MaxSuggestions = (int)sender.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue