mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Modifiers - Cannot input negative values - closes #519
This commit is contained in:
parent
bd6c93b292
commit
1c10eb8aa4
@ -14,9 +14,12 @@ namespace Artemis.UI.DefaultTypes.DataModel.Input
|
||||
|
||||
public void NumberValidationTextBox(object sender, TextCompositionEventArgs e)
|
||||
{
|
||||
string seperator = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;
|
||||
Regex regex = new("^[" + seperator + "][0-9]+$|^[0-9]*[" + seperator + "]{0,1}[0-9]*$");
|
||||
e.Handled = !regex.IsMatch(e.Text);
|
||||
if (e.Text != "-")
|
||||
{
|
||||
string seperator = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;
|
||||
Regex regex = new("^[" + seperator + "][0-9]+$|^[0-9]*[" + seperator + "]{0,1}[0-9]*$");
|
||||
e.Handled = !regex.IsMatch(e.Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -64,6 +64,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings
|
||||
{
|
||||
if (!SetAndNotify(ref _selectedDataBindingMode, value)) return;
|
||||
ApplyDataBindingMode();
|
||||
Update();
|
||||
}
|
||||
}
|
||||
|
||||
@ -145,6 +146,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings
|
||||
|
||||
if (Registration.DataBinding == null)
|
||||
{
|
||||
IsDataBindingEnabled = false;
|
||||
IsEasingTimeEnabled = false;
|
||||
return;
|
||||
}
|
||||
@ -199,7 +201,6 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings
|
||||
|
||||
Registration.DataBinding.ChangeDataBindingMode(SelectedDataBindingMode);
|
||||
CreateDataBindingModeModeViewModel();
|
||||
|
||||
_profileEditorService.UpdateSelectedProfileElement();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user