read mdi window colors from kdeglobals, using WM colors

wilder-pre-rebase
Hugo Pereira Da Costa 12 years ago
parent 631247fac6
commit 1c92b19ada
  1. 8
      kstyle/breezehelper.cpp
  2. 16
      kstyle/breezehelper.h
  3. 5
      kstyle/breezestyle.cpp

@ -60,6 +60,14 @@ namespace Breeze
_viewFocusBrush = KStatefulBrush( KColorScheme::View, KColorScheme::FocusColor, _config );
_viewHoverBrush = KStatefulBrush( KColorScheme::View, KColorScheme::HoverColor, _config );
_viewNegativeTextBrush = KStatefulBrush( KColorScheme::View, KColorScheme::NegativeText, _config );
const QPalette palette( QApplication::palette() );
const KConfigGroup group( _config->group( "WM" ) );
_activeTitleBarColor = group.readEntry( "activeBackground", palette.color( QPalette::Active, QPalette::Highlight ) );
_activeTitleBarTextColor = group.readEntry( "activeForeground", palette.color( QPalette::Active, QPalette::HighlightedText ) );
_inactiveTitleBarColor = group.readEntry( "inactiveBackground", palette.color( QPalette::Disabled, QPalette::Highlight ) );
_inactiveTitleBarTextColor = group.readEntry( "inactiveForeground", palette.color( QPalette::Disabled, QPalette::HighlightedText ) );
}
//____________________________________________________________________

@ -86,6 +86,14 @@ namespace Breeze
QColor shadowColor( const QPalette& palette ) const
{ return alphaColor( palette.color( QPalette::Shadow ), 0.2 ); }
//* titlebar color
const QColor& titleBarColor( bool active ) const
{ return active ? _activeTitleBarColor:_inactiveTitleBarColor; }
//* titlebar text color
const QColor& titleBarTextColor( bool active ) const
{ return active ? _activeTitleBarTextColor:_inactiveTitleBarTextColor; }
//* frame outline color, using animations
QColor frameOutlineColor( const QPalette&, bool mouseOver = false, bool hasFocus = false, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const;
@ -269,6 +277,14 @@ namespace Breeze
KStatefulBrush _viewNegativeTextBrush;
//@}
//*@name windeco colors
//@{
QColor _activeTitleBarColor;
QColor _activeTitleBarTextColor;
QColor _inactiveTitleBarColor;
QColor _inactiveTitleBarTextColor;
//@}
#if HAVE_X11
//* atom used for compositing manager

@ -5544,12 +5544,13 @@ namespace Breeze
// render background
painter->setClipRect( rect );
const QColor outline( _helper->frameOutlineColor( palette, false, false ) );
const QColor background( palette.color( active ? QPalette::Active : QPalette::Disabled, QPalette::Highlight ) );
const QColor background( _helper->titleBarColor( active ) );
_helper->renderTabWidgetFrame( painter, rect.adjusted( -1, -1, 1, 3 ), background, outline, CornersTop );
// render text
palette.setColor( QPalette::WindowText, _helper->titleBarTextColor( active ) );
const QRect textRect( subControlRect( CC_TitleBar, option, SC_TitleBarLabel, widget ) );
ParentStyleClass::drawItemText( painter, textRect, Qt::AlignCenter, palette, active, titleBarOption->text, active ? QPalette::HighlightedText : QPalette::WindowText );
ParentStyleClass::drawItemText( painter, textRect, Qt::AlignCenter, palette, active, titleBarOption->text, QPalette::WindowText );
}

Loading…
Cancel
Save