--- plasma/applets/kickoff/simpleapplet/simpleapplet.cpp~ 2009-03-01 22:30:59.000000000 +0100 +++ plasma/applets/kickoff/simpleapplet/simpleapplet.cpp 2009-03-01 22:34:59.000000000 +0100 @@ -1,6 +1,8 @@ /* Copyright 2007 Robert Knight <robertknight@gmail.com> Copyright 2008 Sebastian Sauer <mail@dipe.org> + Copyright 2008 Helio Chissini de Castro <helio@kde.org> + Copyright 2008 Arthur R Mello <arthur@mandriva.com> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -33,6 +35,8 @@ #include <QtCore/QPointer> #include <QtGui/QGraphicsLinearLayout> #include <QtGui/QSpacerItem> +#include <QSvgRenderer> +#include <QFile> // KDE #include <KIcon> @@ -42,6 +46,7 @@ #include <KActionCollection> #include <KBookmarkMenu> #include <KRun> +#include <KStandardDirs> // Plasma #include <Plasma/IconWidget> @@ -240,9 +245,30 @@ d->formattype = (MenuLauncherApplet::FormatType) e.keyToValue(ba); } - d->icon->setIcon(KIcon(d->viewIcon())); - //d->icon->setIcon(KIcon(cg.readEntry("icon","start-here-kde"))); - //setMinimumContentSize(d->icon->iconSize()); //setSize(d->icon->iconSize()) + KConfig *cfg = new KConfig("mandrivarc"); + KConfigGroup grp = cfg->group("menu"); + QString fileName = grp.exists()? + grp.readEntry("menubutton", + KStandardDirs::locate("data", "mandriva/pics/mdvbutton.svg")) + : + KStandardDirs::locate("data", "mandriva/pics/mdvbutton.svg"); + + bool svgButton = false; + + if(QFile::exists(fileName)) + { + QSvgRenderer *renderer = new QSvgRenderer(fileName); + if(renderer->isValid()) + { + //setMinimumWidth(renderer->defaultSize().width()); + //d->icon->setKeepProportion(true); + d->icon->setSvg(fileName); + svgButton = true; + } + } + + if(!svgButton) + d->icon->setIcon(KIcon(d->viewIcon())); setAspectRatioMode(Plasma::ConstrainedSquare);