API clean : bye bye opacity, wich is bas implemented in all cases
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=796900
This commit is contained in:
parent
b32216ac24
commit
1b15d951a9
22
applet.cpp
22
applet.cpp
@ -112,7 +112,6 @@ public:
|
||||
mainConfig(0),
|
||||
pendingConstraints(NoConstraint),
|
||||
aspectRatioMode(Qt::KeepAspectRatio),
|
||||
opacity(1.0),
|
||||
kioskImmutable(false),
|
||||
immutable(false),
|
||||
hasConfigurationInterface(false),
|
||||
@ -318,7 +317,6 @@ public:
|
||||
KConfigGroup *mainConfig;
|
||||
Plasma::Constraints pendingConstraints;
|
||||
Qt::AspectRatioMode aspectRatioMode;
|
||||
qreal opacity;
|
||||
bool kioskImmutable : 1;
|
||||
bool immutable : 1;
|
||||
bool hasConfigurationInterface : 1;
|
||||
@ -400,7 +398,6 @@ void Applet::save(KConfigGroup* group) const
|
||||
//kDebug() << pluginName() << "geometry is" << geometry() << "pos is" << pos() << "bounding rect is" << boundingRect();
|
||||
group->writeEntry("geometry", geometry());
|
||||
group->writeEntry("zvalue", zValue());
|
||||
group->writeEntry("opacity", d->opacity);
|
||||
|
||||
if (transform() == QTransform()) {
|
||||
group->deleteEntry("transform");
|
||||
@ -438,8 +435,6 @@ void Applet::restore(KConfigGroup *c)
|
||||
if (c->readEntry("locked", false)) {
|
||||
setImmutable(true);
|
||||
}
|
||||
|
||||
setOpacity(c->readEntry("opacity", 1.0));
|
||||
}
|
||||
|
||||
void Applet::saveState(KConfigGroup* group) const
|
||||
@ -918,12 +913,7 @@ void Applet::paintWidget(QPainter *painter, const QStyleOptionGraphicsItem *opti
|
||||
}
|
||||
|
||||
painter->save();
|
||||
|
||||
//Set opacity
|
||||
if (d->opacity >= 0.1 && d->opacity <= 0.9) {
|
||||
painter->setOpacity(d->opacity);
|
||||
}
|
||||
|
||||
|
||||
if (transform().isRotating()) {
|
||||
painter->setRenderHint(QPainter::SmoothPixmapTransform);
|
||||
painter->setRenderHint(QPainter::Antialiasing);
|
||||
@ -1464,16 +1454,6 @@ void Applet::themeChanged()
|
||||
update();
|
||||
}
|
||||
|
||||
void Applet::setOpacity( qreal opacity )
|
||||
{
|
||||
d->opacity = opacity;
|
||||
}
|
||||
|
||||
qreal Applet::opacity() const
|
||||
{
|
||||
return d->opacity;
|
||||
}
|
||||
|
||||
} // Plasma namespace
|
||||
|
||||
#include "applet.moc"
|
||||
|
11
applet.h
11
applet.h
@ -539,17 +539,6 @@ class PLASMA_EXPORT Applet : public Widget
|
||||
**/
|
||||
Containment* containment() const;
|
||||
|
||||
/**
|
||||
* Sets the opacity of this Plasma::Applet
|
||||
* @param opacity the new opacity
|
||||
*/
|
||||
void setOpacity( qreal opacity );
|
||||
|
||||
/**
|
||||
* @return opacity of this Applet
|
||||
**/
|
||||
qreal opacity() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
/**
|
||||
* Emitted when the applet needs to take (or lose) keyboard focus.
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Copyright 2007 by Matt Broadstone <mbroadst@gmail.com>
|
||||
* Copyright 2006-2007 Fredrik Höglund <fredrik@kde.org>
|
||||
* Copyright 2007 by Marco Martin <notmart@gmail.com>
|
||||
* Copyright 2008 by Ménard Alexis <darktears31@gmail.com>
|
||||
* Copyright 2008 by Alexis Ménard <darktears31@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (C) 2007 by Siraj Razick <siraj@kde.org>
|
||||
* Copyright (C) 2007 by Riccardo Iaconelli <riccardo@kde.org>
|
||||
* Copyright (C) 2007 by Matt Broadstone <mbroadst@gmail.com>
|
||||
* Copyright 2008 by Ménard Alexis <darktears31@gmail.com>
|
||||
* Copyright 2008 by Alexis Ménard <darktears31@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
|
@ -55,7 +55,6 @@ class Widget::Private
|
||||
: minimumSize(0,0),
|
||||
maximumSize(std::numeric_limits<qreal>::infinity(),
|
||||
std::numeric_limits<qreal>::infinity()),
|
||||
opacity(1.0),
|
||||
wasMovable(false),
|
||||
toolTip(0)
|
||||
{ }
|
||||
@ -68,8 +67,6 @@ class Widget::Private
|
||||
QSizeF minimumSize;
|
||||
QSizeF maximumSize;
|
||||
|
||||
qreal opacity;
|
||||
|
||||
bool wasMovable;
|
||||
|
||||
bool shouldPaint(QPainter *painter, const QTransform &transform);
|
||||
@ -144,16 +141,6 @@ Widget::~Widget()
|
||||
delete d;
|
||||
}
|
||||
|
||||
void Widget::setOpacity(qreal opacity)
|
||||
{
|
||||
d->opacity = opacity;
|
||||
}
|
||||
|
||||
qreal Widget::opacity() const
|
||||
{
|
||||
return d->opacity;
|
||||
}
|
||||
|
||||
void Widget::setCachePaintMode(CachePaintMode mode, const QSize &size)
|
||||
{
|
||||
setCacheMode(CacheMode(mode), size);
|
||||
@ -255,11 +242,7 @@ void Widget::addChild(Widget *w)
|
||||
|
||||
void Widget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||
{
|
||||
if (d->opacity < 1.0) {
|
||||
painter->setOpacity(painter->opacity() * d->opacity);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
NOTE: put this back if we end up needing to control when things paint due to, e.g. zooming.
|
||||
if (!d->shouldPaint(painter, transform())) {
|
||||
return;
|
||||
|
@ -68,8 +68,6 @@ class PLASMA_EXPORT Widget : public QGraphicsWidget
|
||||
Q_PROPERTY( Qt::Orientations expandingDirections READ expandingDirections )
|
||||
Q_PROPERTY( QRectF geometry READ geometry WRITE setGeometry )
|
||||
Q_PROPERTY( QSizeF size READ size WRITE resize )
|
||||
Q_PROPERTY( qreal opacity READ opacity WRITE setOpacity )
|
||||
|
||||
public:
|
||||
enum CachePaintMode {
|
||||
NoCacheMode,
|
||||
@ -153,9 +151,6 @@ public:
|
||||
*/
|
||||
Q_INVOKABLE void addChild(Widget *widget);
|
||||
|
||||
void setOpacity(qreal opacity);
|
||||
qreal opacity() const;
|
||||
|
||||
/**
|
||||
* Sets the widget's cache paint mode and cache size.
|
||||
* @param mode the new cache paint mode
|
||||
|
Loading…
Reference in New Issue
Block a user