From d475f17bc2b19276140fcfbdf7397b57132506c7 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Thu, 21 Nov 2019 18:02:43 +0300 Subject: [PATCH] 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 --- src/qt/bitcoingui.cpp | 1 + src/qt/res/css/light-hires.css | 14 ++++++++++++++ src/qt/res/css/light.css | 14 ++++++++++++++ src/qt/utilitydialog.cpp | 6 ++++++ src/qt/walletview.cpp | 1 + 5 files changed, 36 insertions(+) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index e28bfb3d61..772d4b5850 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -1499,6 +1499,7 @@ void BitcoinGUI::showProgress(const QString &title, int nProgress) if (nProgress == 0) { progressDialog = new QProgressDialog(title, "", 0, 100); + progressDialog->setStyleSheet(GUIUtil::loadStyleSheet()); progressDialog->setWindowModality(Qt::ApplicationModal); progressDialog->setMinimumDuration(0); progressDialog->setCancelButton(0); diff --git a/src/qt/res/css/light-hires.css b/src/qt/res/css/light-hires.css index 9c3c93e265..7debedb193 100644 --- a/src/qt/res/css/light-hires.css +++ b/src/qt/res/css/light-hires.css @@ -107,6 +107,10 @@ font-size:12px; background-color:#f2f2f2; } +QWidget { /* override text selection background color for all text widgets */ +selection-background-color: #999; +} + /*******************************************************/ QPushButton { /* Global Button Style */ @@ -380,10 +384,20 @@ color:#333; /* DIALOG BOXES */ +.QProgressDialog { +background-color: #F8F6F6; +} + QDialog QWidget { /* Remove Annoying Focus Rectangle */ outline: 0; } +/* SHUTDOWN WINDOW */ + +QWidget#ShutdownWindow { +background-color: #F8F6F6; +} + /*******************************************************/ /* FILE MENU */ diff --git a/src/qt/res/css/light.css b/src/qt/res/css/light.css index 9c3c93e265..7debedb193 100644 --- a/src/qt/res/css/light.css +++ b/src/qt/res/css/light.css @@ -107,6 +107,10 @@ font-size:12px; background-color:#f2f2f2; } +QWidget { /* override text selection background color for all text widgets */ +selection-background-color: #999; +} + /*******************************************************/ QPushButton { /* Global Button Style */ @@ -380,10 +384,20 @@ color:#333; /* DIALOG BOXES */ +.QProgressDialog { +background-color: #F8F6F6; +} + QDialog QWidget { /* Remove Annoying Focus Rectangle */ outline: 0; } +/* SHUTDOWN WINDOW */ + +QWidget#ShutdownWindow { +background-color: #F8F6F6; +} + /*******************************************************/ /* FILE MENU */ diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index 069d8185a4..f02adaa43d 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -14,6 +14,7 @@ #include "bitcoingui.h" #include "clientmodel.h" #include "guiconstants.h" +#include "guiutil.h" #include "intro.h" #include "paymentrequestplus.h" #include "guiutil.h" @@ -199,6 +200,11 @@ void HelpMessageDialog::on_okButton_accepted() ShutdownWindow::ShutdownWindow(QWidget *parent, Qt::WindowFlags f): QWidget(parent, f) { + setObjectName("ShutdownWindow"); + + /* Open CSS when configured */ + this->setStyleSheet(GUIUtil::loadStyleSheet()); + QVBoxLayout *layout = new QVBoxLayout(); layout->addWidget(new QLabel( tr("%1 is shutting down...").arg(tr(PACKAGE_NAME)) + "

" + diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index de99cc29b2..5934444636 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -366,6 +366,7 @@ void WalletView::showProgress(const QString &title, int nProgress) if (nProgress == 0) { progressDialog = new QProgressDialog(title, "", 0, 100); + progressDialog->setStyleSheet(GUIUtil::loadStyleSheet()); progressDialog->setWindowModality(Qt::ApplicationModal); progressDialog->setMinimumDuration(0); progressDialog->setCancelButton(0);