Commit f803a89e authored by Noah Davis's avatar Noah Davis 🌵
Browse files

Fix colors from KStatefulBrushes not using application colorschemes

Summary:
This fixes the colors of things like context menus and application menus

T11124#193132

Test Plan:
Old:
{F7096221}

New:
{F7248348}

Reviewers: #vdg, #breeze

Subscribers: hpereiradacosta, mglb, ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D23170
parent 6b63429f
......@@ -60,9 +60,9 @@ namespace Breeze
//____________________________________________________________________
void Helper::loadConfig()
{
_viewFocusBrush = KStatefulBrush( KColorScheme::View, KColorScheme::FocusColor, _config );
_viewHoverBrush = KStatefulBrush( KColorScheme::View, KColorScheme::HoverColor, _config );
_viewNegativeTextBrush = KStatefulBrush( KColorScheme::View, KColorScheme::NegativeText, _config );
_viewFocusBrush = KStatefulBrush( KColorScheme::View, KColorScheme::FocusColor );
_viewHoverBrush = KStatefulBrush( KColorScheme::View, KColorScheme::HoverColor );
_viewNegativeTextBrush = KStatefulBrush( KColorScheme::View, KColorScheme::NegativeText );
const QPalette palette( QApplication::palette() );
const KConfigGroup group( _config->group( "WM" ) );
......
......@@ -194,9 +194,13 @@ namespace Breeze
QStringLiteral( "/BreezeDecoration" ),
QStringLiteral( "org.kde.Breeze.Style" ),
QStringLiteral( "reparseConfiguration" ), this, SLOT(configurationChanged()) );
#if !BREEZE_USE_KDE4
#if !BREEZE_USE_KDE4
#if QT_VERSION < 0x050D00 // Check if Qt version < 5.13
this->addEventFilter(qApp);
#else
connect(qApp, &QApplication::paletteChanged, this, &Style::configurationChanged);
#endif
#endif
#endif
// call the slot directly; this initial call will set up things that also
// need to be reset when the system palette changes
loadConfiguration();
......@@ -1024,6 +1028,9 @@ namespace Breeze
#if QT_VERSION >= 0x050000
else if( auto commandLinkButton = qobject_cast<QCommandLinkButton*>( object ) ) { return eventFilterCommandLinkButton( commandLinkButton, event ); }
#endif
#if QT_VERSION < 0x050D00 // Check if Qt version < 5.13
else if( object == qApp && event->type() == QEvent::ApplicationPaletteChange ) { configurationChanged(); }
#endif
// cast to QWidget
QWidget *widget = static_cast<QWidget*>( object );
if( widget->inherits( "QAbstractScrollArea" ) || widget->inherits( "KTextEditor::View" ) ) { return eventFilterScrollArea( widget, event ); }
......
Markdown is supported
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