Skip to content

Commit d475f17

Browse files
authored
Fix styles for progress dialogs, shutdown window and text selection (#3212)
* Override text selection background color for all text widgets Otherwie it might become unusable with some system themes * Fix progress dialogs styling * Fix shutdown window styling
1 parent df372ec commit d475f17

File tree

5 files changed

+36
-0
lines changed

5 files changed

+36
-0
lines changed

src/qt/bitcoingui.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,6 +1499,7 @@ void BitcoinGUI::showProgress(const QString &title, int nProgress)
14991499
if (nProgress == 0)
15001500
{
15011501
progressDialog = new QProgressDialog(title, "", 0, 100);
1502+
progressDialog->setStyleSheet(GUIUtil::loadStyleSheet());
15021503
progressDialog->setWindowModality(Qt::ApplicationModal);
15031504
progressDialog->setMinimumDuration(0);
15041505
progressDialog->setCancelButton(0);

src/qt/res/css/light-hires.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ font-size:12px;
107107
background-color:#f2f2f2;
108108
}
109109

110+
QWidget { /* override text selection background color for all text widgets */
111+
selection-background-color: #999;
112+
}
113+
110114
/*******************************************************/
111115

112116
QPushButton { /* Global Button Style */
@@ -380,10 +384,20 @@ color:#333;
380384

381385
/* DIALOG BOXES */
382386

387+
.QProgressDialog {
388+
background-color: #F8F6F6;
389+
}
390+
383391
QDialog QWidget { /* Remove Annoying Focus Rectangle */
384392
outline: 0;
385393
}
386394

395+
/* SHUTDOWN WINDOW */
396+
397+
QWidget#ShutdownWindow {
398+
background-color: #F8F6F6;
399+
}
400+
387401
/*******************************************************/
388402
/* FILE MENU */
389403

src/qt/res/css/light.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ font-size:12px;
107107
background-color:#f2f2f2;
108108
}
109109

110+
QWidget { /* override text selection background color for all text widgets */
111+
selection-background-color: #999;
112+
}
113+
110114
/*******************************************************/
111115

112116
QPushButton { /* Global Button Style */
@@ -380,10 +384,20 @@ color:#333;
380384

381385
/* DIALOG BOXES */
382386

387+
.QProgressDialog {
388+
background-color: #F8F6F6;
389+
}
390+
383391
QDialog QWidget { /* Remove Annoying Focus Rectangle */
384392
outline: 0;
385393
}
386394

395+
/* SHUTDOWN WINDOW */
396+
397+
QWidget#ShutdownWindow {
398+
background-color: #F8F6F6;
399+
}
400+
387401
/*******************************************************/
388402
/* FILE MENU */
389403

src/qt/utilitydialog.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "bitcoingui.h"
1515
#include "clientmodel.h"
1616
#include "guiconstants.h"
17+
#include "guiutil.h"
1718
#include "intro.h"
1819
#include "paymentrequestplus.h"
1920
#include "guiutil.h"
@@ -199,6 +200,11 @@ void HelpMessageDialog::on_okButton_accepted()
199200
ShutdownWindow::ShutdownWindow(QWidget *parent, Qt::WindowFlags f):
200201
QWidget(parent, f)
201202
{
203+
setObjectName("ShutdownWindow");
204+
205+
/* Open CSS when configured */
206+
this->setStyleSheet(GUIUtil::loadStyleSheet());
207+
202208
QVBoxLayout *layout = new QVBoxLayout();
203209
layout->addWidget(new QLabel(
204210
tr("%1 is shutting down...").arg(tr(PACKAGE_NAME)) + "<br /><br />" +

src/qt/walletview.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ void WalletView::showProgress(const QString &title, int nProgress)
366366
if (nProgress == 0)
367367
{
368368
progressDialog = new QProgressDialog(title, "", 0, 100);
369+
progressDialog->setStyleSheet(GUIUtil::loadStyleSheet());
369370
progressDialog->setWindowModality(Qt::ApplicationModal);
370371
progressDialog->setMinimumDuration(0);
371372
progressDialog->setCancelButton(0);

0 commit comments

Comments
 (0)