Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt: Fixing the issue #1149 #2202

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions src/qt/pivx/qtutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Qt::Modifier SHORT_KEY
= Qt::ALT;
#endif

// forward declaration
bool openDialogWithOpaqueBackgroundImpl(QDialog* widget, PIVXGUI* gui, double posX, int posY, Qt::WindowType windowFlags);

// Open dialog at the bottom
bool openDialog(QDialog* widget, QWidget* gui)
{
Expand Down Expand Up @@ -59,7 +62,22 @@ void openDialogFullScreen(QWidget* parent, QWidget* dialog)

bool openDialogWithOpaqueBackgroundY(QDialog* widget, PIVXGUI* gui, double posX, int posY)
{
widget->setWindowFlags(Qt::CustomizeWindowHint);
return openDialogWithOpaqueBackgroundImpl(widget, gui, posX, posY, Qt::CustomizeWindowHint);
}

bool openDialogWithOpaqueBackground(QDialog* widget, PIVXGUI* gui, double posX)
{
return openDialogWithOpaqueBackgroundY(widget, gui, posX, 5);
}

bool openDialogWithOpaqueBackground(QDialog* widget, PIVXGUI* gui, Qt::WindowType windowFlags, double posX)
{
return openDialogWithOpaqueBackgroundImpl(widget, gui, posX, 5, windowFlags);
}

bool openDialogWithOpaqueBackgroundImpl(QDialog* widget, PIVXGUI* gui, double posX, int posY, Qt::WindowType windowFlags)
{
widget->setWindowFlags(windowFlags);
widget->setAttribute(Qt::WA_TranslucentBackground, true);
QPropertyAnimation* animation = new QPropertyAnimation(widget, "pos");
animation->setDuration(300);
Expand All @@ -74,11 +92,6 @@ bool openDialogWithOpaqueBackgroundY(QDialog* widget, PIVXGUI* gui, double posX,
return res;
}

bool openDialogWithOpaqueBackground(QDialog* widget, PIVXGUI* gui, double posX)
{
return openDialogWithOpaqueBackgroundY(widget, gui, posX, 5);
}

bool openDialogWithOpaqueBackgroundFullScreen(QDialog* widget, PIVXGUI* gui)
{
widget->setWindowFlags(Qt::CustomizeWindowHint);
Expand Down
1 change: 1 addition & 0 deletions src/qt/pivx/qtutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ void closeDialog(QDialog* widget, PIVXGUI* gui);
void openDialogFullScreen(QWidget* parent, QWidget* dialog);
bool openDialogWithOpaqueBackgroundY(QDialog* widget, PIVXGUI* gui, double posX = 3, int posY = 5);
bool openDialogWithOpaqueBackground(QDialog* widget, PIVXGUI* gui, double posX = 3);
bool openDialogWithOpaqueBackground(QDialog* widget, PIVXGUI* gui, Qt::WindowType windowFlags, double posX = 3);
bool openDialogWithOpaqueBackgroundFullScreen(QDialog* widget, PIVXGUI* gui);

//
Expand Down
2 changes: 1 addition & 1 deletion src/qt/pivx/topbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ void TopBar::onBtnReceiveClicked()
showHideOp(true);
ReceiveDialog *receiveDialog = new ReceiveDialog(window);
receiveDialog->updateQr(addressStr);
if (openDialogWithOpaqueBackground(receiveDialog, window)) {
if (openDialogWithOpaqueBackground(receiveDialog, window, Qt::Popup)) {
inform(tr("Address Copied"));
}
receiveDialog->deleteLater();
Expand Down