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;
|
mAllowPainting = true;
|
||||||
mDrawDebugOnly = false;
|
mDrawDebugOnly = false;
|
||||||
mPopupEnabled = true;
|
mPopupEnabled = true;
|
||||||
|
mPopupTimer = 0;
|
||||||
|
|
||||||
// ScrollBar Init
|
// ScrollBar Init
|
||||||
setVerticalScrollBar(new AbstractTableScrollBar(verticalScrollBar()));
|
setVerticalScrollBar(new AbstractTableScrollBar(verticalScrollBar()));
|
||||||
|
@ -1292,6 +1293,8 @@ void AbstractTableView::ShowDisassemblyPopup(duint addr, int x, int y)
|
||||||
{
|
{
|
||||||
if(!mPopupEnabled || !addr)
|
if(!mPopupEnabled || !addr)
|
||||||
{
|
{
|
||||||
|
killTimer(mPopupTimer);
|
||||||
|
mPopupTimer = 0;
|
||||||
if(mDisassemblyPopup)
|
if(mDisassemblyPopup)
|
||||||
mDisassemblyPopup->hide();
|
mDisassemblyPopup->hide();
|
||||||
return;
|
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->move(mapToGlobal(QPoint(x + 20, y + fontMetrics().height() * 2)));
|
||||||
mDisassemblyPopup->setAddress(addr);
|
mDisassemblyPopup->setAddress(addr);
|
||||||
mDisassemblyPopup->show();
|
//mDisassemblyPopup->show();
|
||||||
|
mPopupTimer = startTimer(QApplication::startDragTime());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
mDisassemblyPopup->hide();
|
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)
|
void AbstractTableView::hideEvent(QHideEvent* event)
|
||||||
|
|
|
@ -146,6 +146,7 @@ public slots:
|
||||||
|
|
||||||
protected 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 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:
|
private slots:
|
||||||
// Configuration
|
// Configuration
|
||||||
|
@ -211,6 +212,7 @@ private:
|
||||||
bool mDrawDebugOnly;
|
bool mDrawDebugOnly;
|
||||||
bool mPopupEnabled;
|
bool mPopupEnabled;
|
||||||
bool mAllowPainting;
|
bool mAllowPainting;
|
||||||
|
int mPopupTimer;
|
||||||
|
|
||||||
static int mMouseWheelScrollDelta;
|
static int mMouseWheelScrollDelta;
|
||||||
ScrollBar64 mScrollBarAttributes;
|
ScrollBar64 mScrollBarAttributes;
|
||||||
|
|
Loading…
Reference in New Issue