set special palette and special selection rendering for side panel views

wilder-pre-rebase
Hugo Pereira Da Costa 12 years ago
parent 1511678719
commit 49d999b089
  1. 1
      kstyle/breeze.h
  2. 9
      kstyle/breezehelper.cpp
  3. 3
      kstyle/breezehelper.h
  4. 12
      kstyle/breezestyle.cpp

@ -157,6 +157,7 @@ namespace Breeze
// tree view
ItemView_ArrowSize = 10,
ItemView_ItemMarginWidth = 4,
SidePanel_ItemMarginWidth = 4,
// splitter
Splitter_SplitterWidth = 1,

@ -116,6 +116,15 @@ namespace Breeze
return copy;
}
//____________________________________________________________________
QPalette Helper::sideViewPalette( const QPalette& palette ) const
{
QPalette copy( palette );
copy.setColor( QPalette::Active, QPalette::HighlightedText, palette.color( QPalette::Active, QPalette::Highlight ) );
copy.setColor( QPalette::Inactive, QPalette::HighlightedText, palette.color( QPalette::Active, QPalette::Highlight ) );
return copy;
}
//____________________________________________________________________
QColor Helper::arrowColor( const QPalette& palette, bool mouseOver, bool hasFocus, qreal opacity, AnimationMode mode ) const
{

@ -110,6 +110,9 @@ namespace Breeze
//* return altered palette suitable for tinted frames
QPalette framePalette( const QPalette& ) const;
//* return altered palette suitable for tinted frames
QPalette sideViewPalette( const QPalette& ) const;
//* arrow outline color, using animations
QColor arrowColor( const QPalette&, bool mouseOver, bool hasFocus, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const;

@ -306,11 +306,14 @@ namespace Breeze
scrollArea->setFrameStyle( QFrame::NoFrame );
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->setPalette( _helper->sideViewPalette( viewport->palette() ) );
}
}
@ -3155,7 +3158,7 @@ namespace Breeze
// store palette and rect
const QPalette& palette( option->palette );
const QRect& rect( option->rect );
QRect rect( option->rect );
// store flags
const State& state( option->state );
@ -3238,6 +3241,13 @@ namespace Breeze
}
const bool isSidePanel( widget && widget->property( PropertyNames::sidePanelView ).toBool() );
if( isSidePanel )
{
rect.setWidth( Metrics::SidePanel_ItemMarginWidth );
rect = visualRect( option, rect );
}
// render
_helper->renderSelection( painter, rect, color, corners );

Loading…
Cancel
Save