Skip to content

Commit 65f48e3

Browse files
committed
Force priority to 0 when inputing empty
1 parent 6726828 commit 65f48e3

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
Minimum="-999"
7272
SpinButtonPlacementMode="Inline"
7373
ToolTip="{DynamicResource priorityToolTip}"
74+
ValueChanged="NumberBox_OnValueChanged"
7475
Value="{Binding Priority, Mode=TwoWay}" />
7576
</StackPanel>
7677

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1-
namespace Flow.Launcher.Resources.Controls;
1+
using ModernWpf.Controls;
2+
3+
namespace Flow.Launcher.Resources.Controls;
24

35
public partial class InstalledPluginDisplay
46
{
57
public InstalledPluginDisplay()
68
{
79
InitializeComponent();
810
}
11+
12+
private void NumberBox_OnValueChanged(NumberBox sender, NumberBoxValueChangedEventArgs args)
13+
{
14+
if (double.IsNaN(args.NewValue))
15+
{
16+
sender.Value = 0;
17+
}
18+
}
919
}

0 commit comments

Comments
 (0)