Qt/MemoryViewWidget: Keyboard navigation should observe the number of bytes per row instead of assuming 16.

This commit is contained in:
Admiral H. Curtiss 2022-04-26 10:52:13 +02:00
parent b339c6cac1
commit 0e1e2323ea
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB

View File

@ -471,19 +471,19 @@ void MemoryViewWidget::keyPressEvent(QKeyEvent* event)
switch (event->key())
{
case Qt::Key_Up:
m_address -= 16;
m_address -= m_bytes_per_row;
Update();
return;
case Qt::Key_Down:
m_address += 16;
m_address += m_bytes_per_row;
Update();
return;
case Qt::Key_PageUp:
m_address -= rowCount() * 16;
m_address -= rowCount() * m_bytes_per_row;
Update();
return;
case Qt::Key_PageDown:
m_address += rowCount() * 16;
m_address += rowCount() * m_bytes_per_row;
Update();
return;
default: