From kde-commits Mon Apr 14 14:09:15 2008 From: =?utf-8?q?Alexis=20M=C3=A9nard?= Date: Mon, 14 Apr 2008 14:09:15 +0000 To: kde-commits Subject: KDE/kdebase/workspace/libs/plasma Message-Id: <1208182155.547488.10024.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=120818216406465 SVN commit 796900 by menard: API clean : bye bye opacity, wich is bas implemented in all cases M +1 -21 applet.cpp M +0 -11 applet.h M +1 -1 widgets/icon.cpp M +1 -1 widgets/icon.h M +1 -18 widgets/widget.cpp M +0 -5 widgets/widget.h --- trunk/KDE/kdebase/workspace/libs/plasma/applet.cpp #796899:796900 @@ -112,7 +112,6 @@ mainConfig(0), pendingConstraints(NoConstraint), aspectRatioMode(Qt::KeepAspectRatio), - opacity(1.0), kioskImmutable(false), immutable(false), hasConfigurationInterface(false), @@ -318,7 +317,6 @@ KConfigGroup *mainConfig; Plasma::Constraints pendingConstraints; Qt::AspectRatioMode aspectRatioMode; - qreal opacity; bool kioskImmutable : 1; bool immutable : 1; bool hasConfigurationInterface : 1; @@ -400,7 +398,6 @@ //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 @@ if (c->readEntry("locked", false)) { setImmutable(true); } - - setOpacity(c->readEntry("opacity", 1.0)); } void Applet::saveState(KConfigGroup* group) const @@ -918,12 +913,7 @@ } 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 @@ update(); } -void Applet::setOpacity( qreal opacity ) -{ - d->opacity = opacity; -} - -qreal Applet::opacity() const -{ - return d->opacity; -} - } // Plasma namespace #include "applet.moc" --- trunk/KDE/kdebase/workspace/libs/plasma/applet.h #796899:796900 @@ -539,17 +539,6 @@ **/ 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. --- trunk/KDE/kdebase/workspace/libs/plasma/widgets/icon.cpp #796899:796900 @@ -4,7 +4,7 @@ * Copyright 2007 by Matt Broadstone * Copyright 2006-2007 Fredrik Höglund * Copyright 2007 by Marco Martin - * Copyright 2008 by Ménard Alexis + * Copyright 2008 by Alexis Ménard * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as --- trunk/KDE/kdebase/workspace/libs/plasma/widgets/icon.h #796899:796900 @@ -2,7 +2,7 @@ * Copyright (C) 2007 by Siraj Razick * Copyright (C) 2007 by Riccardo Iaconelli * Copyright (C) 2007 by Matt Broadstone -* Copyright 2008 by Ménard Alexis +* Copyright 2008 by Alexis Ménard * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as --- trunk/KDE/kdebase/workspace/libs/plasma/widgets/widget.cpp #796899:796900 @@ -55,7 +55,6 @@ : minimumSize(0,0), maximumSize(std::numeric_limits::infinity(), std::numeric_limits::infinity()), - opacity(1.0), wasMovable(false), toolTip(0) { } @@ -68,8 +67,6 @@ QSizeF minimumSize; QSizeF maximumSize; - qreal opacity; - bool wasMovable; bool shouldPaint(QPainter *painter, const QTransform &transform); @@ -144,16 +141,6 @@ 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::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; --- trunk/KDE/kdebase/workspace/libs/plasma/widgets/widget.h #796899:796900 @@ -68,8 +68,6 @@ 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 @@ */ 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