diff --git a/containment.cpp b/containment.cpp index 213695d9c..a38c8aec3 100644 --- a/containment.cpp +++ b/containment.cpp @@ -205,7 +205,7 @@ void Containment::setContainmentType(Containment::Type type) connect(zoomInTool, SIGNAL(clicked()), this, SLOT(zoomIn())); QGraphicsWidget *zoomOutTool = addToolBoxTool("zoomOut", "zoom-out", i18n("Zoom Out")); - connect(zoomOutTool, SIGNAL(clicked()), this, SIGNAL(zoomOut())); + connect(zoomOutTool, SIGNAL(clicked()), this, SLOT(zoomOut())); if (immutability() != SystemImmutable) { QGraphicsWidget *lockTool = addToolBoxTool("lockWidgets", "object-locked", @@ -498,11 +498,6 @@ void Containment::toggleDesktopImmutability() d->setLockToolText(); } -void Containment::zoomIn() -{ - emit zoomIn(this); -} - void Containment::addSiblingContainment() { emit addSiblingContainment(this); @@ -899,6 +894,16 @@ void Containment::closeToolBox() // Private class implementation +void Containment::Private::zoomIn() +{ + emit q->zoomRequested(q, Plasma::ZoomIn); +} + +void Containment::Private::zoomOut() +{ + emit q->zoomRequested(q, Plasma::ZoomOut); +} + Toolbox* Containment::Private::createToolBox() { if (!toolBox) { diff --git a/containment.h b/containment.h index c3b2a8e3d..607bcdb05 100644 --- a/containment.h +++ b/containment.h @@ -287,16 +287,9 @@ class PLASMA_EXPORT Containment : public Applet void appletRemoved(Plasma::Applet* applet); /** - * Emitted when the containment requests zooming in one step. - * Usually only used for desktop containments. + * Emitted when the containment requests zooming in or out one step. */ - void zoomIn(Plasma::Containment *); - - /** - * Emitted when the containment requests zooming out one step. - * Usually only used for desktop containments. - */ - void zoomOut(); + void zoomRequested(Plasma::Containment * containment, Plasma::ZoomDirection direction); /** * Emitted when the containment wants a new containment to be created. @@ -347,12 +340,6 @@ class PLASMA_EXPORT Containment : public Applet */ void toggleDesktopImmutability(); - /** - * Make the containment request zooming in one step. - * Usually only used for desktop containments. - */ - void zoomIn(); - /** * Tells the corona to create a new desktop containment */ @@ -394,6 +381,8 @@ class PLASMA_EXPORT Containment : public Applet Q_PRIVATE_SLOT(d, void handleDisappeared(AppletHandle *handle)) Q_PRIVATE_SLOT(d, void destroyApplet()) Q_PRIVATE_SLOT(d, void positionToolBox()) + Q_PRIVATE_SLOT(d, void zoomIn()) + Q_PRIVATE_SLOT(d, void zoomOut()) friend class Applet; class Private; diff --git a/containment_p.h b/containment_p.h index 1f239ea10..e743fe046 100644 --- a/containment_p.h +++ b/containment_p.h @@ -69,6 +69,8 @@ public: void destroyApplet(); void appletDestroyed(QObject*); void appletAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation anim); + void zoomIn(); + void zoomOut(); Applet* addApplet(const QString& name, const QVariantList& args = QVariantList(), const QRectF &geometry = QRectF(-1, -1, -1, -1), uint id = 0, diff --git a/plasma.h b/plasma.h index 9c1479873..e1f4c98aa 100644 --- a/plasma.h +++ b/plasma.h @@ -80,6 +80,13 @@ enum Direction { Down = 0 /**< Display downards */ , Right /**< Display to the right */ }; +/** + * The direction of a zoom action. + */ +enum ZoomDirection { ZoomIn = 0 /**< Zoom in one step */, + ZoomOut = 1 /**< Zoom out one step */ + }; + /** * The Location enumeration describes where on screen an element, such as an * Applet or its managing container, is positioned on the screen.