slightly alter sidepanel background color

wilder-pre-rebase
Hugo Pereira Da Costa 12 years ago
parent ba0fd306f8
commit be382f86b0
  1. 17
      kstyle/breezehelper.cpp
  2. 3
      kstyle/breezehelper.h
  3. 10
      kstyle/breezestyle.cpp

@ -129,6 +129,10 @@ namespace Breeze
QColor Helper::frameBackgroundColor( const QPalette& palette, QPalette::ColorGroup role ) const
{ return KColorUtils::mix( palette.color( role, QPalette::Window ), palette.color( role, QPalette::Base ), 0.3 ); }
//____________________________________________________________________
QColor Helper::sidePanelBackgroundColor( const QPalette& palette, QPalette::ColorGroup role ) const
{ return KColorUtils::mix( palette.color( role, QPalette::Window ), palette.color( role, QPalette::Base ), 0.6 ); }
//____________________________________________________________________
QPalette Helper::framePalette( const QPalette& palette ) const
{
@ -143,11 +147,14 @@ namespace Breeze
QPalette Helper::sideViewPalette( const QPalette& palette ) const
{
QPalette copy( palette );
// alter default text color
copy.setColor( QPalette::Disabled, QPalette::Text, palette.color( QPalette::Disabled, QPalette::WindowText ) );
copy.setColor( QPalette::Active, QPalette::Text, palette.color( QPalette::Active, QPalette::WindowText ) );
copy.setColor( QPalette::Inactive, QPalette::Text, palette.color( QPalette::Inactive, QPalette::WindowText ) );
copy.setColor( QPalette::Disabled, QPalette::Base, sidePanelBackgroundColor( palette, QPalette::Disabled ) );
copy.setColor( QPalette::Active, QPalette::Base, sidePanelBackgroundColor( palette, QPalette::Active ) );
copy.setColor( QPalette::Inactive, QPalette::Base, sidePanelBackgroundColor( palette, QPalette::Inactive ) );
// // alter default text color
// copy.setColor( QPalette::Disabled, QPalette::Text, palette.color( QPalette::Disabled, QPalette::WindowText ) );
// copy.setColor( QPalette::Active, QPalette::Text, palette.color( QPalette::Active, QPalette::WindowText ) );
// copy.setColor( QPalette::Inactive, QPalette::Text, palette.color( QPalette::Inactive, QPalette::WindowText ) );
return copy;

@ -110,6 +110,9 @@ namespace Breeze
//* frame background color
QColor frameBackgroundColor( const QPalette&, QPalette::ColorGroup ) const;
//* frame background color
QColor sidePanelBackgroundColor( const QPalette&, QPalette::ColorGroup ) const;
//* return altered palette suitable for tinted frames
QPalette framePalette( const QPalette& ) const;

@ -296,16 +296,16 @@ namespace Breeze
{
// force flat
// scrollArea->setFrameStyle( QFrame::NoFrame );
scrollArea->setBackgroundRole( QPalette::Window );
scrollArea->setForegroundRole( QPalette::WindowText );
// scrollArea->setBackgroundRole( QPalette::Window );
// scrollArea->setForegroundRole( QPalette::WindowText );
scrollArea->setPalette( _helper->sideViewPalette( scrollArea->palette() ) );
scrollArea->setProperty( PropertyNames::sidePanelView, true );
if( QWidget *viewport = scrollArea->viewport() )
{
viewport->setBackgroundRole( QPalette::Window );
viewport->setForegroundRole( QPalette::WindowText );
viewport->setAutoFillBackground( false );
// viewport->setBackgroundRole( QPalette::Window );
// viewport->setForegroundRole( QPalette::WindowText );
// viewport->setAutoFillBackground( false );
viewport->setPalette( _helper->sideViewPalette( viewport->palette() ) );
}

Loading…
Cancel
Save