Skip to content
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
9 changes: 8 additions & 1 deletion src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,15 @@ void CHighPrecisionTimer::run()
/******************************************************************************\
* GUI Utilities *
\******************************************************************************/
// About dialog ----------------------------------------------------------------
#ifndef HEADLESS
// Dialog base class -----------------------------------------------------------
CBaseDlg::CBaseDlg ( QWidget* parent, Qt::WindowFlags flags ) : QDialog ( parent, flags )
{
// give the dialog the application palette inherited from the environment
setPalette ( QApplication::palette ( this ) );
}

// About dialog ----------------------------------------------------------------
CAboutDlg::CAboutDlg ( QWidget* parent ) : CBaseDlg ( parent )
{
setupUi ( this );
Expand Down
20 changes: 1 addition & 19 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,27 +401,9 @@ class CBaseDlg : public QDialog
Q_OBJECT

public:
CBaseDlg ( QWidget* parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags() ) : QDialog ( parent, flags ) {}
CBaseDlg ( QWidget* parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags() );

protected:
bool event ( QEvent* pEvent ) override
{
// a window keeps the palette it resolved when it was created.
// the system colour scheme is only known after the first window is shown
// (especially visible on iOS), so the dialogs which are created in the client
// dialog's constructor, would be painted with black text on the dark background
// until something repaints them (#3999).

const bool bHandled = QDialog::event ( pEvent );

if ( pEvent->type() == QEvent::Show )
{
setPalette ( QPalette() );
}

return bHandled;
}

public slots:
void keyPressEvent ( QKeyEvent* pEvent )
{
Expand Down
Loading