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

List:       kde-commits
Subject:    Re: KDE/kdebase/workspace/libs/plasma
From:       Marco Martin <notmart () gmail ! com>
Date:       2008-02-11 12:56:35
Message-ID: 200802111356.36550.notmart () gmail ! com
[Download RAW message or body]

On Monday 11 February 2008, Aaron J. Seigo wrote:
> SVN commit 773505 by aseigo:
>
> die, setSize, die, and all the problems you represent. silly duplicated,
> not-like-qwidget API anyways. ;)
>
hmm, now i get wrongly sized items in boxlayouts (for example in twitter and 
system monitor) i get the vertical layout with the size of the applet instead 
of the content size, so the content is too big and cutted
i suppose it's caused by this commit but uhm, don't know :)

Cheers,
Marco Martin

>
>  M  +6 -30     applet.cpp
>  M  +0 -10     applet.h
>  M  +1 -1      widgets/flash.cpp
>  M  +0 -10     widgets/widget.cpp
>  M  +0 -2      widgets/widget.h
>
>
> --- trunk/KDE/kdebase/workspace/libs/plasma/applet.cpp #773504:773505
> @@ -1352,52 +1352,28 @@
>      return Widget::itemChange(change, value);
>  }
>
> -void Applet::setSize(int width, int height)
> -{
> -    setSize(QSizeF(width, height));
> -}
> -
> -void Applet::setSize(const QSizeF &size)
> -{
> -    setGeometry(QRectF(pos(), size));
> -}
> -
>  void Applet::setGeometry(const QRectF& geometry)
>  {
>      Plasma::Constraints updatedConstraints(0);
> +    QSizeF s = size();
> +    QPointF p = pos();
>
> -    if (geometry.size().width() > 0 && geometry.size().height() > 0 &&
> size() != geometry.size()) { -        prepareGeometryChange();
> -        qreal width = qBound(minimumSize().width(),
> geometry.size().width(), maximumSize().width()); -        qreal height =
> qBound(minimumSize().height(), geometry.size().height(),
> maximumSize().height()); -
> -        // it is important we call Widget::setSize(QSizeF) here to avoid
> recursing back to this -        // method, creating an infinite loop
> -        Widget::setSize(QSizeF(width, height));
> -
> -        if (layout()) {
> -            layout()->setGeometry(QRectF(QPoint(0, 0), contentSize()));
> -        }
> -
> -        if (managingLayout()) {
> -            managingLayout()->invalidate();
> -        }
> -
> +    Widget::setGeometry(geometry);
> +    if (s != size()) {
>          if (d->background) {
>              d->background->resize(size());
>          }
> +
>          updatedConstraints |= Plasma::SizeConstraint;
>      }
>
> -    if (geometry.topLeft() != pos()) {
> -        setPos(geometry.topLeft());
> +    if (p != pos()) {
>          updatedConstraints |= Plasma::LocationConstraint;
>      }
>
>      if (updatedConstraints) {
>          updateConstraints(updatedConstraints);
>          emit geometryChanged();
> -        update();
>      }
>  }
>
> --- trunk/KDE/kdebase/workspace/libs/plasma/applet.h #773504:773505
> @@ -729,16 +729,6 @@
>           */
>          QVariant itemChange(GraphicsItemChange change, const QVariant
> &value);
>
> -        /**
> -         * Reimplemented from QGraphicsItem
> -         */
> -        void setSize(int width, int height);
> -
> -        /**
> -         * Reimplemented from QGraphicsItem
> -         */
> -        void setSize(const QSizeF& size);
> -
>      protected Q_SLOTS:
>          /**
>           * @internal used to show the configuration of an applet on first
> show --- trunk/KDE/kdebase/workspace/libs/plasma/widgets/flash.cpp
> #773504:773505 @@ -70,7 +70,7 @@
>      d->color = Qt::black;
>      d->animId = 0;
>      d->state = Private::Invisible;
> -    setSize(QSizeF(40, 100));
> +    resize(QSizeF(40, 100));
>
>      setCachePaintMode( NoCacheMode );
>  }
> --- trunk/KDE/kdebase/workspace/libs/plasma/widgets/widget.cpp
> #773504:773505 @@ -273,16 +273,6 @@
>      update();
>  }
>
> -void Widget::setSize(qreal width, qreal height)
> -{
> -    setSize(QSizeF(width, height));
> -}
> -
> -void Widget::setSize(const QSizeF& size)
> -{
> -    d->size = size;
> -}
> -
>  void Widget::updateGeometry()
>  {
>      if (managingLayout()) {
> --- trunk/KDE/kdebase/workspace/libs/plasma/widgets/widget.h #773504:773505
> @@ -307,8 +307,6 @@
>      virtual void paintWidget(QPainter *painter, const
> QStyleOptionGraphicsItem *option, QWidget *widget = 0);
>
>      QVariant itemChange(GraphicsItemChange change, const QVariant &value);
> -    void setSize(qreal width, qreal height);
> -    virtual void setSize(const QSizeF& size);
>      void managingLayoutChanged();
>
>      virtual bool sceneEvent(QEvent *event);


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

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