Color roles, coming this Monday to kdelibs?

Olaf Schmidt ojschmidt at kde.org
Mon Jun 18 10:38:14 BST 2007


[ Matthew Woehlke, Mo., 18. Jun. 2007 ]
> I've no code handy and therefore can't offer an actual patch, but the
> quickest change is simply to replace: 
>
> KGlobalSettings::toolBarHighlightColor()
> - with -
> 
KColorScheme(KColorScheme::Button).decoration(KColorScheme::HoverColor).color()

The colour is here used for the text, so it should instead be 
KColorScheme(KColorScheme::Button).forground(KColorScheme::ActiveText)

The change would be in line 811 of
http://lxr.kde.org/source/koffice/libs/guiutils/KoTooluButton.cpp#811 :

      // Draw the text at the position given by textRect, and using textFlags
      if (!textLabel().isNull() && !textRect.isNull()) {
          _painter->setFont( KGlobalSettings::toolBarFont() );
          if ( !isEnabled() )
              _painter->setPen( palette().disabled().dark() );
          else if( KToolBarButton::isRaised() )
-             _painter->setPen( KGlobalSettings::toolBarHighlightColor() );
+             _painter->setBrush( 
KColorScheme(KColorScheme::Button).forground(KColorScheme::ActiveText) );
          else
              _painter->setPen( colorGroup().buttonText() );
          _painter->drawText( textRect, textFlags, textLabel() );


(No real diff, sorry.)

Olaf




More information about the kde-core-devel mailing list