Bug fix for debugger assembly viewport scroll bars. Page size is now proper computed for both horizontal and vertical bars. Now hide horizontal bar if viewport is large enough to show full amount of longest line.

This commit is contained in:
mjbudd77 2021-07-17 20:04:09 -04:00
parent e4f5384069
commit 7eb3dcddb7
1 changed files with 22 additions and 5 deletions

View File

@ -3459,10 +3459,21 @@ void QAsmView::updateAssemblyView(void)
asmEntry.push_back(a);
}
pxLineWidth = maxLineLen * pxCharWidth;
pxLineWidth = (maxLineLen+1) * pxCharWidth;
//setMaximumWidth( pxLineWidth + 10 );
if ( viewWidth >= pxLineWidth )
{
hbar->hide();
}
else
{
hbar->setPageStep( viewWidth );
hbar->setMaximum( pxLineWidth - viewWidth );
hbar->show();
}
//setMaximumWidth( pxLineWidth );
vbar->setPageStep( (3*viewLines)/4 );
vbar->setMaximum( asmEntry.size() );
determineLineBreakpoints();
@ -3809,12 +3820,14 @@ void ConsoleDebugger::hbarChanged(int value)
{
//printf("HBar Changed: %i\n", value);
asmView->setXScroll( value );
asmView->update();
}
//----------------------------------------------------------------------------
void ConsoleDebugger::vbarChanged(int value)
{
//printf("VBar Changed: %i\n", value);
asmView->setLine( value );
asmView->update();
}
//----------------------------------------------------------------------------
void bpDebugSetEnable(bool val)
@ -4403,7 +4416,7 @@ void QAsmView::setXScroll(int value)
}
else
{
pxLineXScroll = (int)(0.010f * (float)value * (float)(pxLineWidth - viewWidth) );
pxLineXScroll = value;
}
}
//----------------------------------------------------------------------------
@ -4845,12 +4858,16 @@ void QAsmView::resizeEvent(QResizeEvent *event)
if ( viewWidth >= pxLineWidth )
{
pxLineXScroll = 0;
hbar->hide();
}
else
{
pxLineXScroll = (int)(0.010f * (float)hbar->value() * (float)(pxLineWidth - viewWidth) );
hbar->setPageStep( viewWidth );
hbar->setMaximum( pxLineWidth - viewWidth );
hbar->show();
pxLineXScroll = hbar->value();
}
vbar->setPageStep( (3*viewLines)/4 );
}
//----------------------------------------------------------------------------
void QAsmView::keyPressEvent(QKeyEvent *event)