SL-10890 Ban duration edit field shows value with a left shift if a large value was set

master
andreykproductengine 2019-04-05 22:42:04 +03:00
parent 64341c8b19
commit d1b649055d
3 changed files with 15 additions and 1 deletions

View File

@ -499,6 +499,13 @@ void LLLineEditor::setCursorToEnd()
deselect();
}
void LLLineEditor::resetScrollPosition()
{
mScrollHPos = 0;
// make sure cursor says in visible range
setCursor(getCursor());
}
BOOL LLLineEditor::canDeselect() const
{
return hasSelection();

View File

@ -208,6 +208,9 @@ public:
void setCursor( S32 pos );
void setCursorToEnd();
// set scroll to earliest position it can reasonable set
void resetScrollPosition();
// Selects characters 'start' to 'end'.
void setSelection(S32 start, S32 end);
virtual void getSelectionRange(S32 *position, S32 *length) const;

View File

@ -290,6 +290,7 @@ void LLSpinCtrl::forceSetValue(const LLSD& value )
LLF32UICtrl::setValue(value);
updateEditor();
mEditor->resetScrollPosition();
}
}
@ -355,7 +356,9 @@ void LLSpinCtrl::onEditorCommit( const LLSD& data )
if( success )
{
updateEditor();
// We commited and clamped value
// try to display as much as possible
mEditor->resetScrollPosition();
}
else
{
@ -475,6 +478,7 @@ BOOL LLSpinCtrl::handleKeyHere(KEY key, MASK mask)
// text editors don't support revert normally (due to user confusion)
// but not allowing revert on a spinner seems dangerous
updateEditor();
mEditor->resetScrollPosition();
mEditor->setFocus(FALSE);
return TRUE;
}