Commit 8315fe4b authored by David Faure's avatar David Faure
Browse files

Statusbar progress widget: update up/down icon when dialog goes away

Summary:
The two need to always be in sync. The button was still showing "down"
when the dialog went away with a timer.

Since slotToggleVisibility() ends up calling StatusbarProgressWidget::slotProgressDialogVisible
slotProgressButtonClicked() doesn't need to updateProgressButton() directly.

Test Plan: Looking at the button at the end of a sync

Reviewers: mlaurent, dvratil

Reviewed By: dvratil

Subscribers: kde-pim

Differential Revision: https://phabricator.kde.org/D21067
parent 30d17d2d
......@@ -261,7 +261,7 @@ void StatusbarProgressWidget::setMode(Mode mode)
mStackedWidget->setCurrentWidget(mProgressBar);
if (mShowButton) {
mShowDetailedProgress = mProgressDialog->wasLastShown();
updateProgressButton();
updateProgressButton(mShowDetailedProgress);
mButton->show();
}
mSslLabel->setState(mSslLabel->lastState());
......@@ -293,9 +293,9 @@ bool StatusbarProgressWidget::eventFilter(QObject *obj, QEvent *ev)
return QFrame::eventFilter(obj, ev);
}
void StatusbarProgressWidget::updateProgressButton()
void StatusbarProgressWidget::updateProgressButton(bool showingProgress)
{
if (!mShowDetailedProgress) {
if (!showingProgress) {
mButton->setIcon(QIcon::fromTheme(QStringLiteral("go-up")));
mButton->setToolTip(i18n("Show detailed progress window"));
} else {
......@@ -308,7 +308,6 @@ void StatusbarProgressWidget::slotProgressButtonClicked()
{
mProgressDialog->slotToggleVisibility();
mShowDetailedProgress = !mProgressDialog->isHidden();
updateProgressButton();
setFixedWidth(qMax(600, mProgressDialog->width()));
}
......@@ -319,4 +318,6 @@ void StatusbarProgressWidget::slotProgressDialogVisible(bool b)
if (b) {
setMode(Progress);
}
updateProgressButton(b);
}
......@@ -87,7 +87,7 @@ private:
Clean
};
void setMode(Mode mode);
void updateProgressButton();
void updateProgressButton(bool showingProgress);
void connectSingleItem();
void activateSingleItemMode();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment