mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-01-01 10:13:30 +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)
|
public void NumberValidationTextBox(object sender, TextCompositionEventArgs e)
|
||||||
{
|
{
|
||||||
string seperator = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;
|
if (e.Text != "-")
|
||||||
Regex regex = new("^[" + seperator + "][0-9]+$|^[0-9]*[" + seperator + "]{0,1}[0-9]*$");
|
{
|
||||||
e.Handled = !regex.IsMatch(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;
|
if (!SetAndNotify(ref _selectedDataBindingMode, value)) return;
|
||||||
ApplyDataBindingMode();
|
ApplyDataBindingMode();
|
||||||
|
Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,6 +146,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings
|
|||||||
|
|
||||||
if (Registration.DataBinding == null)
|
if (Registration.DataBinding == null)
|
||||||
{
|
{
|
||||||
|
IsDataBindingEnabled = false;
|
||||||
IsEasingTimeEnabled = false;
|
IsEasingTimeEnabled = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -199,7 +201,6 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.DataBindings
|
|||||||
|
|
||||||
Registration.DataBinding.ChangeDataBindingMode(SelectedDataBindingMode);
|
Registration.DataBinding.ChangeDataBindingMode(SelectedDataBindingMode);
|
||||||
CreateDataBindingModeModeViewModel();
|
CreateDataBindingModeModeViewModel();
|
||||||
|
|
||||||
_profileEditorService.UpdateSelectedProfileElement();
|
_profileEditorService.UpdateSelectedProfileElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user