[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/libs/plasma
From:       Alexis Ménard <darktears31 () gmail ! com>
Date:       2008-04-14 14:09:15
Message-ID: 1208182155.547488.10024.nullmailer () svn ! kde ! org
[Download RAW message or body]

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 <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
--- trunk/KDE/kdebase/workspace/libs/plasma/widgets/icon.h #796899:796900
@@ -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
--- trunk/KDE/kdebase/workspace/libs/plasma/widgets/widget.cpp #796899:796900
@@ -55,7 +55,6 @@
             : 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 @@
         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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic