Skip to content

Commit d159cb1

Browse files
committed
Merge bitcoin#1133: [Bug][GUI] Topbar sync progressbar not expanding fixed.
a25afdc [Bug][GUI] Fix, topbar sync progressbar expanded with the expandable view. (furszy) Pull request description: The sync progressBar was not been expanded following the sync expandable button size. This PR fixes it. Solving bitcoin#1090 ACKs for top commit: Fuzzbawls: ACK a25afdc random-zebra: ACK a25afdc Tree-SHA512: 834ce61a1caa4b709c8762d6d8c3538ce68ed99b188fd913610a3b2d922c6331a636fad90873decfd86d0a74cb554c6ae101d2da2c7c3ab1a310494cd9d9506c
2 parents a34a7df + a25afdc commit d159cb1

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

src/qt/pivx/topbar.cpp

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ TopBar::TopBar(PIVXGUI* _mainWindow, QWidget *parent) :
111111
connect(ui->pushButtonTheme, SIGNAL(Mouse_Pressed()), this, SLOT(onThemeClicked()));
112112
connect(ui->pushButtonFAQ, SIGNAL(Mouse_Pressed()), _mainWindow, SLOT(openFAQ()));
113113
connect(ui->pushButtonColdStaking, SIGNAL(Mouse_Pressed()), this, SLOT(onColdStakingClicked()));
114+
connect(ui->pushButtonSync, &ExpandableButton::Mouse_HoverLeave, this, &TopBar::refreshProgressBarSize);
115+
connect(ui->pushButtonSync, &ExpandableButton::Mouse_Hover, this, &TopBar::refreshProgressBarSize);
114116
}
115117

116118
void TopBar::onThemeClicked(){
@@ -122,12 +124,11 @@ void TopBar::onThemeClicked(){
122124
if(lightTheme){
123125
ui->pushButtonTheme->setButtonClassStyle("cssClass", "btn-check-theme-light", true);
124126
ui->pushButtonTheme->setButtonText("Light Theme");
125-
updateStyle(ui->pushButtonTheme);
126127
}else{
127128
ui->pushButtonTheme->setButtonClassStyle("cssClass", "btn-check-theme-dark", true);
128129
ui->pushButtonTheme->setButtonText("Dark Theme");
129-
updateStyle(ui->pushButtonTheme);
130130
}
131+
updateStyle(ui->pushButtonTheme);
131132

132133
emit themeChanged(lightTheme);
133134
}
@@ -144,7 +145,7 @@ void TopBar::onBtnLockClicked(){
144145
connect(lockUnlockWidget, SIGNAL(Mouse_Leave()), this, SLOT(lockDropdownMouseLeave()));
145146
connect(ui->pushButtonLock, &ExpandableButton::Mouse_HoverLeave, [this](){
146147
QMetaObject::invokeMethod(this, "lockDropdownMouseLeave", Qt::QueuedConnection);
147-
}); //, SLOT(lockDropdownMouseLeave()));
148+
});
148149
connect(lockUnlockWidget, SIGNAL(lockClicked(
149150
const StateClicked&)),this, SLOT(lockDropdownClicked(
150151
const StateClicked&)));
@@ -559,4 +560,16 @@ void TopBar::updateBalances(const CAmount& balance, const CAmount& unconfirmedBa
559560
void TopBar::resizeEvent(QResizeEvent *event){
560561
if (lockUnlockWidget && lockUnlockWidget->isVisible()) lockDropdownMouseLeave();
561562
QWidget::resizeEvent(event);
563+
}
564+
565+
void TopBar::refreshProgressBarSize() {
566+
QMetaObject::invokeMethod(this, "expandSync", Qt::QueuedConnection);
567+
}
568+
569+
void TopBar::expandSync() {
570+
if (progressBar) {
571+
progressBar->setMaximumWidth(ui->pushButtonSync->maximumWidth());
572+
progressBar->setFixedWidth(ui->pushButtonSync->width());
573+
progressBar->setMinimumWidth(ui->pushButtonSync->width() - 2);
574+
}
562575
}

src/qt/pivx/topbar.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ private slots:
6363
void refreshStatus();
6464
void openLockUnlock();
6565
void onColdStakingClicked();
66+
void refreshProgressBarSize();
67+
void expandSync();
6668
private:
6769
Ui::TopBar *ui;
6870
LockUnlock *lockUnlockWidget = nullptr;

0 commit comments

Comments
 (0)