Skip to content

Commit

Permalink
[GUI] Fix proposal tooltip menu location skewing
Browse files Browse the repository at this point in the history
When there are enough proposals to need the GUI to scroll down to see
them all, the location of the tooltip menu gets skewed to the point of
it not being visible. This is because it's location was being based on
the initial position of the proposal card, even for off-screen ones.

This fixes the issue by taking the scrollarea's vertical scrollbar value
 into consideration.

Github-Pull: #2664
Rebased-From: 4ba2c4c
  • Loading branch information
Fuzzbawls authored and furszy committed Dec 11, 2021
1 parent 55619cc commit 33f5dd8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/qt/pivx/governancewidget.cpp
Expand Up @@ -10,6 +10,7 @@

#include <QDesktopServices>
#include <QGraphicsDropShadowEffect>
#include <QScrollBar>
#include <QTimer>

void initComboView(PWidget* parent, QComboBox* comboBox, const QString& filterHint, const QList<QString>& values)
Expand Down Expand Up @@ -187,7 +188,7 @@ void GovernanceWidget::onMenuClicked(ProposalCard* card)
QRect rect = card->geometry();
QPoint pos = rect.topRight();
pos.setX(pos.x() - 22);
pos.setY(pos.y() + (isSync ? 100 : 140));
pos.setY(pos.y() + (isSync ? 100 : 140) - ui->scrollArea->verticalScrollBar()->value());
propMenu->move(pos);
propMenu->show();
}
Expand Down

0 comments on commit 33f5dd8

Please sign in to comment.