Merge pull request #6676 from aws-lumberyard-dev/Atom/mriegger/format
Remove 'INF' from integer widget and replace it with better formatted…
This commit is contained in:
+12
-30
@@ -14,6 +14,7 @@
|
||||
#include <AzToolsFramework/UI/PropertyEditor/PropertyQTConstants.h>
|
||||
#include <AzToolsFramework/UI/PropertyEditor/QtWidgetLimits.h>
|
||||
#include <QtWidgets/QWidget>
|
||||
#include <QLocale>
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
@@ -92,25 +93,11 @@ namespace AzToolsFramework
|
||||
{
|
||||
toolTipString += "\n";
|
||||
}
|
||||
toolTipString += "[";
|
||||
if (propertyControl->minimum() <= aznumeric_cast<AZ::s64>(QtWidgetLimits<T>::Min()))
|
||||
{
|
||||
toolTipString += "-" + QObject::tr(PropertyQTConstant_InfinityString);
|
||||
}
|
||||
else
|
||||
{
|
||||
toolTipString += QString::number(propertyControl->minimum());
|
||||
}
|
||||
toolTipString += ", ";
|
||||
if (propertyControl->maximum() >= aznumeric_cast<AZ::s64>(QtWidgetLimits<T>::Max()))
|
||||
{
|
||||
toolTipString += QObject::tr(PropertyQTConstant_InfinityString);
|
||||
}
|
||||
else
|
||||
{
|
||||
toolTipString += QString::number(propertyControl->maximum());
|
||||
}
|
||||
toolTipString += "]";
|
||||
|
||||
const QString minString = QLocale().toString(propertyControl->minimum());
|
||||
const QString maxString = QLocale().toString(propertyControl->maximum());
|
||||
toolTipString += QString("[%1, %2]").arg(minString).arg(maxString);
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -128,16 +115,11 @@ namespace AzToolsFramework
|
||||
{
|
||||
toolTipString += "\n";
|
||||
}
|
||||
toolTipString += "[" + QString::number(propertyControl->minimum()) + ", ";
|
||||
if (propertyControl->maximum() >= aznumeric_cast<AZ::s64>(QtWidgetLimits<T>::Max()))
|
||||
{
|
||||
toolTipString += QObject::tr(PropertyQTConstant_InfinityString);
|
||||
}
|
||||
else
|
||||
{
|
||||
toolTipString += QString::number(propertyControl->maximum());
|
||||
}
|
||||
toolTipString += "]";
|
||||
|
||||
const QString minString = QLocale().toString(propertyControl->minimum());
|
||||
const QString maxString = QLocale().toString(propertyControl->maximum());
|
||||
toolTipString += QString("[%1, %2]").arg(minString).arg(maxString);
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -196,7 +178,7 @@ namespace AzToolsFramework
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ_WarningOnce("AzToolsFramework", false, "Property %s: 'Min' attribute from property '%s' into widget", debugName);
|
||||
AZ_WarningOnce("AzToolsFramework", false, "Failed to read 'Min' attribute from property '%s' into widget", debugName);
|
||||
}
|
||||
}
|
||||
else if (attrib == AZ::Edit::Attributes::Max)
|
||||
|
||||
Reference in New Issue
Block a user