Set a small delay for appearance of disassembly popup
This commit is contained in:
parent
c2c0f75434
commit
c0684f923d
|
@ -58,6 +58,7 @@ AbstractTableView::AbstractTableView(QWidget* parent)
|
|||
mAllowPainting = true;
|
||||
mDrawDebugOnly = false;
|
||||
mPopupEnabled = true;
|
||||
mPopupTimer = 0;
|
||||
|
||||
// ScrollBar Init
|
||||
setVerticalScrollBar(new AbstractTableScrollBar(verticalScrollBar()));
|
||||
|
@ -1292,6 +1293,8 @@ void AbstractTableView::ShowDisassemblyPopup(duint addr, int x, int y)
|
|||
{
|
||||
if(!mPopupEnabled || !addr)
|
||||
{
|
||||
killTimer(mPopupTimer);
|
||||
mPopupTimer = 0;
|
||||
if(mDisassemblyPopup)
|
||||
mDisassemblyPopup->hide();
|
||||
return;
|
||||
|
@ -1304,10 +1307,26 @@ void AbstractTableView::ShowDisassemblyPopup(duint addr, int x, int y)
|
|||
{
|
||||
mDisassemblyPopup->move(mapToGlobal(QPoint(x + 20, y + fontMetrics().height() * 2)));
|
||||
mDisassemblyPopup->setAddress(addr);
|
||||
mDisassemblyPopup->show();
|
||||
//mDisassemblyPopup->show();
|
||||
mPopupTimer = startTimer(QApplication::startDragTime());
|
||||
}
|
||||
else
|
||||
{
|
||||
mDisassemblyPopup->hide();
|
||||
killTimer(mPopupTimer);
|
||||
mPopupTimer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void AbstractTableView::timerEvent(QTimerEvent* event)
|
||||
{
|
||||
if(event->timerId() == mPopupTimer)
|
||||
{
|
||||
mDisassemblyPopup->show();
|
||||
killTimer(mPopupTimer);
|
||||
mPopupTimer = 0;
|
||||
}
|
||||
QAbstractScrollArea::timerEvent(event);
|
||||
}
|
||||
|
||||
void AbstractTableView::hideEvent(QHideEvent* event)
|
||||
|
|
|
@ -146,6 +146,7 @@ public slots:
|
|||
|
||||
protected slots:
|
||||
void ShowDisassemblyPopup(duint addr, int x, int y); // this should probably be a slot, but doesn't need emit fixes (it's already used correctly)
|
||||
void timerEvent(QTimerEvent* event);
|
||||
|
||||
private slots:
|
||||
// Configuration
|
||||
|
@ -211,6 +212,7 @@ private:
|
|||
bool mDrawDebugOnly;
|
||||
bool mPopupEnabled;
|
||||
bool mAllowPainting;
|
||||
int mPopupTimer;
|
||||
|
||||
static int mMouseWheelScrollDelta;
|
||||
ScrollBar64 mScrollBarAttributes;
|
||||
|
|
Loading…
Reference in New Issue