mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
plasma: remove unused source and header files
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
0fcbeab9fb
commit
6e8feccb93
3 changed files with 0 additions and 163 deletions
|
@ -58,7 +58,6 @@ set(plasma_LIB_SRCS
|
|||
animations/pixmaptransition.cpp
|
||||
animations/pulser.cpp
|
||||
animations/slide.cpp
|
||||
animations/stackedlayout.cpp
|
||||
animations/geometry.cpp
|
||||
animations/widgetsnapshot.cpp
|
||||
animations/zoom.cpp
|
||||
|
|
|
@ -1,108 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2009 Igor Trindade Oliveira <igor.oliveira@indt.org.br>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "stackedlayout.h"
|
||||
|
||||
#include <QGraphicsWidget>
|
||||
#include <QDebug>
|
||||
|
||||
StackedLayout::StackedLayout(QGraphicsLayoutItem *parent)
|
||||
: QObject(0),
|
||||
QGraphicsLayout(parent),
|
||||
m_currentWidgetIndex(-1)
|
||||
{
|
||||
}
|
||||
|
||||
StackedLayout::~StackedLayout()
|
||||
{
|
||||
}
|
||||
|
||||
void StackedLayout::setGeometry(const QRectF &rect)
|
||||
{
|
||||
QGraphicsLayout::setGeometry(rect);
|
||||
|
||||
const QRectF effectiveRect = geometry();
|
||||
|
||||
for(int i = 0; i < items.size(); i++) {
|
||||
itemAt(i)->setGeometry(effectiveRect);
|
||||
}
|
||||
}
|
||||
|
||||
QSizeF StackedLayout::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
|
||||
{
|
||||
Q_UNUSED(which);
|
||||
Q_UNUSED(constraint);
|
||||
|
||||
qreal left, top, right, bottom;
|
||||
getContentsMargins(&left, &top, &right, &bottom);
|
||||
|
||||
if (m_currentWidgetIndex <= 0 || !itemAt(m_currentWidgetIndex)) {
|
||||
return QSizeF();
|
||||
}
|
||||
|
||||
QSizeF currentWidgetSize = itemAt(m_currentWidgetIndex)->effectiveSizeHint(which, constraint);
|
||||
|
||||
return QSizeF( left + right + currentWidgetSize.width(), right + bottom + currentWidgetSize.height());
|
||||
}
|
||||
|
||||
int StackedLayout::count() const
|
||||
{
|
||||
return items.count();
|
||||
}
|
||||
|
||||
QGraphicsLayoutItem *StackedLayout::itemAt(int i) const
|
||||
{
|
||||
return items.at(i);
|
||||
}
|
||||
|
||||
void StackedLayout::insertWidget(QGraphicsLayoutItem *item, int pos)
|
||||
{
|
||||
if(!pos && (m_currentWidgetIndex == -1)) {
|
||||
m_currentWidgetIndex = 0;
|
||||
} else {
|
||||
item->graphicsItem()->hide();
|
||||
}
|
||||
|
||||
items.insert(pos, item);
|
||||
activate();
|
||||
}
|
||||
|
||||
void StackedLayout::addWidget(QGraphicsLayoutItem *item)
|
||||
{
|
||||
insertWidget(item, items.size());
|
||||
}
|
||||
|
||||
void StackedLayout::removeAt(int index)
|
||||
{
|
||||
items.removeAt(index);
|
||||
}
|
||||
|
||||
void StackedLayout::setCurrentWidgetIndex(qint32 index)
|
||||
{
|
||||
QGraphicsItem *currentWidget = itemAt(m_currentWidgetIndex)->graphicsItem();
|
||||
QGraphicsItem *hiddenWidget = itemAt(index)->graphicsItem();
|
||||
|
||||
currentWidget->hide();
|
||||
hiddenWidget->show();
|
||||
|
||||
m_currentWidgetIndex = index;
|
||||
}
|
||||
|
||||
qint32 StackedLayout::currentWidgetIndex() const
|
||||
{
|
||||
return m_currentWidgetIndex;
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2009 Igor Trindade Oliveira <igor.oliveira@indt.org.br>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef STACKEDLAYOUT_H
|
||||
#define STACKEDLAYOUT_H
|
||||
|
||||
/* TODO: document the methods */
|
||||
|
||||
#include <QGraphicsLayout>
|
||||
#include <QList>
|
||||
#include <QObject>
|
||||
|
||||
class StackedLayout : public QObject, public QGraphicsLayout
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QGraphicsLayout)
|
||||
|
||||
public:
|
||||
explicit StackedLayout(QGraphicsLayoutItem *parent = 0);
|
||||
~StackedLayout();
|
||||
|
||||
void setGeometry(const QRectF &rect);
|
||||
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const;
|
||||
int count() const;
|
||||
QGraphicsLayoutItem *itemAt(int i) const;
|
||||
|
||||
void insertWidget(QGraphicsLayoutItem *item, int pos);
|
||||
void addWidget(QGraphicsLayoutItem *item);
|
||||
|
||||
void removeAt(int index);
|
||||
|
||||
qint32 currentWidgetIndex() const;
|
||||
void setCurrentWidgetIndex(qint32 index);
|
||||
|
||||
private:
|
||||
QList<QGraphicsLayoutItem *> items;
|
||||
qint32 m_currentWidgetIndex;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Reference in a new issue