Move Validators to UM, so they can be used in UM components.

Update all TextFieldWithUnit to use our FloatValidator. This component now has proper styling when the input is invalid. The DoubleValidator was flagging numbers with a "." in them as an incorrect input (I assume this is because the region was set to europe on the OS where "," is common). The workaround is to use our FloatValidator which validates both "." and ","

CURA-9793
This commit is contained in:
Joey de l'Arago 2022-12-07 16:27:42 +01:00
parent 0e5ad96207
commit f601229390
7 changed files with 6 additions and 53 deletions

View file

@ -1,4 +1,4 @@
// Copyright (c) 2022 Ultimaker B.V.
// Copyright (c) 2022 UltiMaker
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.15
@ -6,8 +6,8 @@ import QtQuick.Controls 2.2
import QtQuick.Window 2.1
import QtQuick.Layouts 1.1
import UM 1.5 as UM
import Cura 1.1 as Cura
import UM 1.7 as UM
import Cura 1.7 as Cura
/*
@ -119,7 +119,7 @@ UM.Dialog
text = `#${text}`;
}
}
validator: Cura.HexColorValidator {}
validator: UM.HexColorValidator {}
}
Rectangle