Force priority to 0 when inputing empty

This commit is contained in:
Jack251970 2025-04-07 14:54:09 +08:00
parent 67268284e0
commit 65f48e3069
2 changed files with 12 additions and 1 deletions

View file

@ -71,6 +71,7 @@
Minimum="-999"
SpinButtonPlacementMode="Inline"
ToolTip="{DynamicResource priorityToolTip}"
ValueChanged="NumberBox_OnValueChanged"
Value="{Binding Priority, Mode=TwoWay}" />
</StackPanel>

View file

@ -1,4 +1,6 @@
namespace Flow.Launcher.Resources.Controls;
using ModernWpf.Controls;
namespace Flow.Launcher.Resources.Controls;
public partial class InstalledPluginDisplay
{
@ -6,4 +8,12 @@ public partial class InstalledPluginDisplay
{
InitializeComponent();
}
private void NumberBox_OnValueChanged(NumberBox sender, NumberBoxValueChangedEventArgs args)
{
if (double.IsNaN(args.NewValue))
{
sender.Value = 0;
}
}
}