From 97371a74c201ff0036cd8572a907782472c2d050 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Mon, 10 May 2010 16:36:56 +0000 Subject: [PATCH] Moved hover and focus brush from Oxygen::StyleHelper to OxygenHelper so that they can be used in in the decoration, for optimization. Added "NegativeText" brush, to optimize rendering of close buttons. Renamed OxygenHelper to Oxygen::Helper for consistency with the other classes. (needs full update of workspace/libs/oxygen, kstyles/oxygen and kwin/clients/oxygen, but this is already true for the above ...) svn path=/trunk/KDE/kdebase/workspace/; revision=1125082 --- clients/oxygen/oxygenbutton.cpp | 8 ++++---- clients/oxygen/oxygendecohelper.cpp | 2 +- clients/oxygen/oxygendecohelper.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/clients/oxygen/oxygenbutton.cpp b/clients/oxygen/oxygenbutton.cpp index 88e2ca4054..c8144e5322 100644 --- a/clients/oxygen/oxygenbutton.cpp +++ b/clients/oxygen/oxygenbutton.cpp @@ -218,8 +218,8 @@ namespace Oxygen buttonDetailColor( palette ); QColor glow = (type_ == ButtonClose || type_ == ButtonItemClose ) ? - KColorScheme(palette.currentColorGroup()).foreground(KColorScheme::NegativeText).color(): - KColorScheme(palette.currentColorGroup()).decoration(KColorScheme::HoverColor).color(); + helper_.viewNegativeTextBrush().brush(palette).color(): + helper_.viewHoverBrush().brush(palette).color(); glow = helper_.calcDarkColor( glow ); if( isAnimated() ) color = KColorUtils::mix( color, glow, glowIntensity() ); @@ -331,7 +331,7 @@ namespace Oxygen case ButtonAbove: if(isChecked()) { QPen newPen = painter->pen(); - newPen.setColor(KColorScheme(palette.currentColorGroup()).decoration(KColorScheme::HoverColor).color()); + newPen.setColor(helper_.viewHoverBrush().brush(palette).color()); painter->setPen(newPen); } @@ -344,7 +344,7 @@ namespace Oxygen case ButtonBelow: if(isChecked()) { QPen newPen = painter->pen(); - newPen.setColor(KColorScheme(palette.currentColorGroup()).decoration(KColorScheme::HoverColor).color()); + newPen.setColor(helper_.viewHoverBrush().brush( palette ).color() ); painter->setPen(newPen); } diff --git a/clients/oxygen/oxygendecohelper.cpp b/clients/oxygen/oxygendecohelper.cpp index d5879d96dc..535e7bcca5 100644 --- a/clients/oxygen/oxygendecohelper.cpp +++ b/clients/oxygen/oxygendecohelper.cpp @@ -26,7 +26,7 @@ namespace Oxygen { //______________________________________________________________________________ DecoHelper::DecoHelper(const QByteArray &componentName): - OxygenHelper(componentName) + Helper(componentName) {} //______________________________________________________________________________ diff --git a/clients/oxygen/oxygendecohelper.h b/clients/oxygen/oxygendecohelper.h index 4fe07f2e3c..260fa5e74e 100644 --- a/clients/oxygen/oxygendecohelper.h +++ b/clients/oxygen/oxygendecohelper.h @@ -27,7 +27,7 @@ /*! contains utility functions used at multiple places in oxygen style */ namespace Oxygen { - class DecoHelper : public OxygenHelper + class DecoHelper : public Helper { public: