This commit is contained in:
Thomas Jentzsch 2019-07-27 11:45:50 +02:00
parent 3eed4fa3a9
commit 8e177cf627
2 changed files with 7 additions and 3 deletions

View File

@ -170,8 +170,12 @@ void RomListWidget::setHighlighted(int item)
_highlightedItem = item;
// Only scroll the list if we're about to pass the page boundary
if(_currentPos == 0)
_currentPos = _highlightedItem;
if (_highlightedItem < _currentPos)
{
_currentPos -= _rows;
if (_currentPos < 0)
_currentPos = 0;
}
else if(_highlightedItem == _currentPos + _rows)
_currentPos += _rows;

View File

@ -94,7 +94,7 @@ class RomListWidget : public EditableWidget
int _bytesWidth;
int _rows;
int _cols;
int _currentPos;
int _currentPos; // position of first line in visible window
int _selectedItem;
int _highlightedItem;
bool _editMode;