API REVIEW: color() --> die
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=801697
This commit is contained in:
parent
7672b1620c
commit
1474ed7cbc
32
applet.cpp
32
applet.cpp
@ -999,38 +999,6 @@ QList<QAction*> Applet::contextualActions()
|
|||||||
return d->script ? d->script->contextualActions() : QList<QAction*>();
|
return d->script ? d->script->contextualActions() : QList<QAction*>();
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor Applet::color() const
|
|
||||||
{
|
|
||||||
// TODO: add more colors for more categories and
|
|
||||||
// maybe read from config?
|
|
||||||
QString c = category();
|
|
||||||
int alpha = 200;
|
|
||||||
// Colors taken from Oxygen color palette
|
|
||||||
if (c == "Date and Time") {
|
|
||||||
return QColor(191, 94, 0, alpha);
|
|
||||||
} else if (c == "Environment & Weather") {
|
|
||||||
return QColor(191, 0, 0, alpha);
|
|
||||||
} else if (c == "Examples") {
|
|
||||||
return QColor(204, 0, 154, alpha);
|
|
||||||
} else if (c == "File System") {
|
|
||||||
return QColor(90, 0, 179, alpha);
|
|
||||||
} else if (c == "Graphics") {
|
|
||||||
return QColor(0, 0, 255, alpha);
|
|
||||||
} else if (c == "Language") {
|
|
||||||
return QColor(0, 191, 0, alpha);
|
|
||||||
} else if (c == "Mapping") {
|
|
||||||
return QColor(191, 245, 0, alpha);
|
|
||||||
} else if (c == "Online Services") {
|
|
||||||
return QColor(255, 213, 0, alpha);
|
|
||||||
} else if (c == "System Information") {
|
|
||||||
return QColor(0, 196, 204, alpha);
|
|
||||||
} else if (c == "Windows and Tasks") {
|
|
||||||
return QColor(255, 126, 0, alpha);
|
|
||||||
} else {
|
|
||||||
return QColor(136, 136, 136, alpha);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Applet::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void Applet::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
{
|
{
|
||||||
if (d->shadow && d->shadow->shadowedSize() != boundingRect().size()) {
|
if (d->shadow && d->shadow->shadowedSize() != boundingRect().size()) {
|
||||||
|
5
applet.h
5
applet.h
@ -377,11 +377,6 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
*/
|
*/
|
||||||
QString category() const;
|
QString category() const;
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the color corresponding to the applet's category.
|
|
||||||
*/
|
|
||||||
QColor color() const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The type of immutability of this applet
|
* @return The type of immutability of this applet
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user