extender is not a Plasma Widget (it doesn't follow the API pattern, isn't a button/menu/etc, isn't meant to be used as a general widget in a random layout...)
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=841164
This commit is contained in:
parent
0dd6b99014
commit
577a64f563
@ -35,6 +35,8 @@ set(plasma_LIB_SRCS
|
|||||||
dataenginemanager.cpp
|
dataenginemanager.cpp
|
||||||
delegate.cpp
|
delegate.cpp
|
||||||
dialog.cpp
|
dialog.cpp
|
||||||
|
extender.cpp
|
||||||
|
extenderitem.cpp
|
||||||
paintutils.cpp
|
paintutils.cpp
|
||||||
panelsvg.cpp
|
panelsvg.cpp
|
||||||
plasma.cpp
|
plasma.cpp
|
||||||
@ -63,8 +65,6 @@ set(plasma_LIB_SRCS
|
|||||||
view.cpp
|
view.cpp
|
||||||
widgets/checkbox.cpp
|
widgets/checkbox.cpp
|
||||||
widgets/combobox.cpp
|
widgets/combobox.cpp
|
||||||
widgets/extender.cpp
|
|
||||||
widgets/extenderitem.cpp
|
|
||||||
widgets/flash.cpp
|
widgets/flash.cpp
|
||||||
widgets/frame.cpp
|
widgets/frame.cpp
|
||||||
widgets/groupbox.cpp
|
widgets/groupbox.cpp
|
||||||
@ -135,6 +135,8 @@ set(plasma_LIB_INCLUDES
|
|||||||
dataenginemanager.h
|
dataenginemanager.h
|
||||||
delegate.h
|
delegate.h
|
||||||
dialog.h
|
dialog.h
|
||||||
|
extender.h
|
||||||
|
extenderitem.h
|
||||||
paintutils.h
|
paintutils.h
|
||||||
panelsvg.h
|
panelsvg.h
|
||||||
plasma.h
|
plasma.h
|
||||||
@ -166,8 +168,6 @@ install(FILES
|
|||||||
install(FILES
|
install(FILES
|
||||||
widgets/checkbox.h
|
widgets/checkbox.h
|
||||||
widgets/combobox.h
|
widgets/combobox.h
|
||||||
widgets/extender.h
|
|
||||||
widgets/extenderitem.h
|
|
||||||
widgets/flash.h
|
widgets/flash.h
|
||||||
widgets/frame.h
|
widgets/frame.h
|
||||||
widgets/groupbox.h
|
widgets/groupbox.h
|
||||||
|
@ -63,6 +63,8 @@
|
|||||||
#include "containment.h"
|
#include "containment.h"
|
||||||
#include "corona.h"
|
#include "corona.h"
|
||||||
#include "dataenginemanager.h"
|
#include "dataenginemanager.h"
|
||||||
|
#include "extender.h"
|
||||||
|
#include "extenderitem.h"
|
||||||
#include "package.h"
|
#include "package.h"
|
||||||
#include "plasma.h"
|
#include "plasma.h"
|
||||||
#include "scripting/appletscript.h"
|
#include "scripting/appletscript.h"
|
||||||
@ -72,8 +74,6 @@
|
|||||||
#include "view.h"
|
#include "view.h"
|
||||||
#include "widgets/label.h"
|
#include "widgets/label.h"
|
||||||
#include "widgets/pushbutton.h"
|
#include "widgets/pushbutton.h"
|
||||||
#include "widgets/extender.h"
|
|
||||||
#include "widgets/extenderitem.h"
|
|
||||||
#include "tooltipmanager.h"
|
#include "tooltipmanager.h"
|
||||||
|
|
||||||
#include "private/containment_p.h"
|
#include "private/containment_p.h"
|
||||||
|
6
applet.h
6
applet.h
@ -44,12 +44,12 @@ class KActionCollection;
|
|||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
|
|
||||||
|
class AppletPrivate;
|
||||||
class Containment;
|
class Containment;
|
||||||
class DataEngine;
|
class DataEngine;
|
||||||
class Package;
|
|
||||||
class AppletPrivate;
|
|
||||||
class ExtenderItem;
|
|
||||||
class Extender;
|
class Extender;
|
||||||
|
class ExtenderItem;
|
||||||
|
class Package;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @short The base Applet class
|
* @short The base Applet class
|
||||||
|
@ -523,10 +523,6 @@ Applet* Containment::addApplet(const QString& name, const QVariantList& args, co
|
|||||||
return d->addApplet(name, args, appletGeometry);
|
return d->addApplet(name, args, appletGeometry);
|
||||||
}
|
}
|
||||||
|
|
||||||
//pos must be relative to the containment already. use mapfromscene.
|
|
||||||
//what we're trying to do here for panels is make the applet go to the requested position,
|
|
||||||
//or somewhere close to it, and get integrated properly into the containment as if it were created
|
|
||||||
//there.
|
|
||||||
void Containment::addApplet(Applet *applet, const QPointF &pos, bool delayInit)
|
void Containment::addApplet(Applet *applet, const QPointF &pos, bool delayInit)
|
||||||
{
|
{
|
||||||
if (!delayInit && immutability() != Mutable) {
|
if (!delayInit && immutability() != Mutable) {
|
||||||
|
@ -95,7 +95,6 @@ class PLASMA_EXPORT DataContainer : public QObject
|
|||||||
void connectVisualization(QObject* visualization, uint pollingInterval, Plasma::IntervalAlignment alignment);
|
void connectVisualization(QObject* visualization, uint pollingInterval, Plasma::IntervalAlignment alignment);
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disconnects an object from this DataContainer.
|
* Disconnects an object from this DataContainer.
|
||||||
**/
|
**/
|
||||||
@ -118,6 +117,7 @@ class PLASMA_EXPORT DataContainer : public QObject
|
|||||||
* requests to be updated.
|
* requests to be updated.
|
||||||
**/
|
**/
|
||||||
void updateRequested(DataContainer *source);
|
void updateRequested(DataContainer *source);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* Checks for whether the data has changed and therefore an update
|
* Checks for whether the data has changed and therefore an update
|
||||||
@ -148,7 +148,6 @@ protected Q_SLOTS:
|
|||||||
*/
|
*/
|
||||||
void checkUsage();
|
void checkUsage();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class SignalRelay;
|
friend class SignalRelay;
|
||||||
DataContainerPrivate* const d;
|
DataContainerPrivate* const d;
|
||||||
|
10
dataengine.h
10
dataengine.h
@ -55,11 +55,6 @@ class DataEnginePrivate;
|
|||||||
**/
|
**/
|
||||||
class PLASMA_EXPORT DataEngine : public QObject
|
class PLASMA_EXPORT DataEngine : public QObject
|
||||||
{
|
{
|
||||||
friend class DataEnginePrivate;
|
|
||||||
friend class DataEngineScript;
|
|
||||||
friend class DataEngineManager;
|
|
||||||
friend class NullEngine;
|
|
||||||
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY( QStringList sources READ sources )
|
Q_PROPERTY( QStringList sources READ sources )
|
||||||
Q_PROPERTY( bool valid READ isValid )
|
Q_PROPERTY( bool valid READ isValid )
|
||||||
@ -424,6 +419,11 @@ class PLASMA_EXPORT DataEngine : public QObject
|
|||||||
void removeSource(const QString& source);
|
void removeSource(const QString& source);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
friend class DataEnginePrivate;
|
||||||
|
friend class DataEngineScript;
|
||||||
|
friend class DataEngineManager;
|
||||||
|
friend class NullEngine;
|
||||||
|
|
||||||
Q_PRIVATE_SLOT(d, void internalUpdateSource(DataContainer* source))
|
Q_PRIVATE_SLOT(d, void internalUpdateSource(DataContainer* source))
|
||||||
|
|
||||||
DataEnginePrivate* const d;
|
DataEnginePrivate* const d;
|
||||||
|
@ -17,19 +17,20 @@
|
|||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "extender_p.h"
|
|
||||||
#include "extender.h"
|
#include "extender.h"
|
||||||
|
|
||||||
#include <QGraphicsLinearLayout>
|
|
||||||
#include <QGraphicsGridLayout>
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
#include <QGraphicsGridLayout>
|
||||||
|
#include <QGraphicsLinearLayout>
|
||||||
|
|
||||||
#include "plasma/applet.h"
|
#include "applet.h"
|
||||||
#include "plasma/private/applet_p.h"
|
#include "containment.h"
|
||||||
#include "plasma/containment.h"
|
#include "corona.h"
|
||||||
#include "plasma/corona.h"
|
#include "extenderitem.h"
|
||||||
#include "plasma/widgets/extenderitem.h"
|
#include "widgets/label.h"
|
||||||
#include "plasma/widgets/label.h"
|
|
||||||
|
#include "private/applet_p.h"
|
||||||
|
#include "private/extender_p.h"
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
@ -31,16 +31,18 @@ class ExtenderItem;
|
|||||||
class Applet;
|
class Applet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An extender is a widget where items can be added to. These so called ExtenderItems can be
|
* An Extender is a widget that visually extends the normal contents of an applet with
|
||||||
* detached by the user an dropped in other extenders or somewhere else, in which case a new
|
* additional dynamic widgets called ExtenderItems. These ExtenderItems can be
|
||||||
* extenderapplet is created and the item is added there.
|
* detached by the user and dropped either on another Extender or on the canvas directly.
|
||||||
* This widget allows using ExtenderItems in you applet. Extender takes care of the presentation
|
*
|
||||||
* of a collection of extenderitems, and keeps track of extenderItems that originated in it.
|
* This widget allows using ExtenderItems in your applet. Extender takes care of the presentation
|
||||||
* This default extender displays extender items in a vertical layout, and shows spacers in this
|
* of a collection of ExtenderItems and keeps track of ExtenderItems that originate in it.
|
||||||
* layout when hovering with an extender item over it, which is probably good for most cases.
|
*
|
||||||
|
* The default Extender implementation displays extender items in a vertical layout with
|
||||||
|
* spacers that appear when dropping an ExtenderItem over it.
|
||||||
|
*
|
||||||
* If you wish to have a different presentation of extender items, you can choose to subclass
|
* If you wish to have a different presentation of extender items, you can choose to subclass
|
||||||
* this class. In this case you'll need to reimplement the extenderItem* events and optionally
|
* Extender and reimplement the extenderItem* events and, optionally, the saveState function.
|
||||||
* the saveState function.
|
|
||||||
*/
|
*/
|
||||||
class PLASMA_EXPORT Extender : public QGraphicsWidget
|
class PLASMA_EXPORT Extender : public QGraphicsWidget
|
||||||
{
|
{
|
||||||
@ -175,3 +177,4 @@ class PLASMA_EXPORT Extender : public QGraphicsWidget
|
|||||||
} // Plasma namespace
|
} // Plasma namespace
|
||||||
|
|
||||||
#endif //EXTENDER_H
|
#endif //EXTENDER_H
|
||||||
|
|
@ -19,27 +19,28 @@
|
|||||||
|
|
||||||
#include "extenderitem.h"
|
#include "extenderitem.h"
|
||||||
|
|
||||||
#include <QtGui/QPainter>
|
|
||||||
#include <QtGui/QGraphicsSceneResizeEvent>
|
|
||||||
#include <QtGui/QGraphicsSceneMouseEvent>
|
|
||||||
#include <QtGui/QGraphicsLinearLayout>
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
#include <QGraphicsSceneResizeEvent>
|
||||||
|
#include <QGraphicsSceneMouseEvent>
|
||||||
|
#include <QGraphicsLinearLayout>
|
||||||
|
#include <QPainter>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
#include <KDE/KDebug>
|
#include <KDebug>
|
||||||
#include <KDE/KIcon>
|
#include <KIcon>
|
||||||
#include <KDE/KWindowSystem>
|
#include <KWindowSystem>
|
||||||
|
|
||||||
#include "plasma/corona.h"
|
#include "applet.h"
|
||||||
#include "plasma/containment.h"
|
#include "containment.h"
|
||||||
#include "plasma/theme.h"
|
#include "corona.h"
|
||||||
#include "plasma/view.h"
|
#include "extender.h"
|
||||||
#include "plasma/applet.h"
|
#include "panelsvg.h"
|
||||||
#include "plasma/private/applet_p.h"
|
#include "theme.h"
|
||||||
#include "plasma/panelsvg.h"
|
#include "view.h"
|
||||||
#include "plasma/widgets/extender.h"
|
|
||||||
#include "plasma/widgets/extender_p.h"
|
#include "private/applet_p.h"
|
||||||
|
#include "private/extender_p.h"
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
@ -1,2 +1,2 @@
|
|||||||
#include "../../plasma/widgets/extender.h"
|
#include "../../plasma/extender.h"
|
||||||
|
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
#include "../../plasma/widgets/extenderitem.h"
|
#include "../../plasma/extenderitem.h"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user