summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2019-04-17 16:47:51 +0300
committerAndreyL ProductEngine <alihatskiy@productengine.com>2019-04-17 16:47:51 +0300
commit07f1c4c9c59c3b825a605dd9c695aae492bbf09c (patch)
tree2571081bfc63485b9fb4d2ff8521dca36fda9ed3 /indra/llui
parentc45eff54cbf4a273f57ec62a23dd33c93fbb0c94 (diff)
parent81dbd3663bdaff741e68de0ec4d4d35bedf6649d (diff)
Merged in lindenlab/viewer-release
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lllineeditor.cpp7
-rw-r--r--indra/llui/lllineeditor.h3
-rw-r--r--indra/llui/llspinctrl.cpp6
3 files changed, 15 insertions, 1 deletions
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index cfab6b7fc8..ff8bf30319 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -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();
diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h
index 287837a15c..f775d53e63 100644
--- a/indra/llui/lllineeditor.h
+++ b/indra/llui/lllineeditor.h
@@ -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;
diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp
index f6831c6d5e..ce3fc29d32 100644
--- a/indra/llui/llspinctrl.cpp
+++ b/indra/llui/llspinctrl.cpp
@@ -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;
}