diff --git a/clients/modernsystem/CMakeLists.txt b/clients/modernsystem/CMakeLists.txt index d2396ae0d9..11200c8721 100644 --- a/clients/modernsystem/CMakeLists.txt +++ b/clients/modernsystem/CMakeLists.txt @@ -8,7 +8,7 @@ set(kwin3_modernsys_PART_SRCS modernsys.cpp) kde4_add_plugin(kwin3_modernsys ${kwin3_modernsys_PART_SRCS}) -target_link_libraries(kwin3_modernsys ${KDE4_KDEFX_LIBS} kdecorations ${QT_QTGUI_LIBRARY}) +target_link_libraries(kwin3_modernsys kdecorations ${QT_QTGUI_LIBRARY}) install(TARGETS kwin3_modernsys DESTINATION ${PLUGIN_INSTALL_DIR}) diff --git a/clients/modernsystem/modernsys.cpp b/clients/modernsystem/modernsys.cpp index b469751107..15f45ef55b 100644 --- a/clients/modernsystem/modernsys.cpp +++ b/clients/modernsystem/modernsys.cpp @@ -28,7 +28,6 @@ //Added by qt3to4: #include #include -#include #include #include @@ -165,6 +164,15 @@ static void make_button_fx(const QPalette &g, QPixmap *pix, bool light=false) } } +static void gradientFill(QPixmap *pixmap, const QColor &color1, const QColor &color2) +{ + QPainter p(pixmap); + QLinearGradient gradient(0, 0, 0, pixmap->height()); + gradient.setColorAt(0.0, color1); + gradient.setColorAt(1.0, color2); + QBrush brush(gradient); + p.fillRect(pixmap->rect(), brush); +} static void create_pixmaps() { @@ -181,14 +189,12 @@ static void create_pixmaps() if(QPixmap::defaultDepth() > 8){ aUpperGradient = new QPixmap( 32, title_height+2 ); iUpperGradient = new QPixmap( 32, title_height+2);; - KPixmapEffect::gradient(*aUpperGradient, - options()->color(KDecoration::ColorTitleBar, true).light(130), - options()->color(KDecoration::ColorTitleBlend, true), - KPixmapEffect::VerticalGradient); - KPixmapEffect::gradient(*iUpperGradient, - options()->color(KDecoration::ColorTitleBar, false).light(130), - options()->color(KDecoration::ColorTitleBlend, false), - KPixmapEffect::VerticalGradient); + gradientFill(aUpperGradient, + options()->color(KDecoration::ColorTitleBar, true).light(130), + options()->color(KDecoration::ColorTitleBlend, true)); + gradientFill(iUpperGradient, + options()->color(KDecoration::ColorTitleBar, false).light(130), + options()->color(KDecoration::ColorTitleBlend, false)); } // buttons QPalette btnColor(options()->palette(KDecoration::ColorButtonBg, true) );