Commit 1a30a53f authored by Casper Boemann's avatar Casper Boemann

move zoom tool to flake

as suggested by thomas

svn path=/trunk/koffice/; revision=639258
parent 18a5012e
......@@ -59,6 +59,7 @@ set(flake_SRCS
KoToolRegistry.cpp
KoToolProxy.cpp
KoShapeSavingContext.cpp
KoZoomTool.cpp
commands/KoShapeGroupCommand.cpp
commands/KoShapeAlignCommand.cpp
commands/KoShapeBackgroundCommand.cpp
......
......@@ -28,10 +28,10 @@
#include <kstandarddirs.h>
#include <kcursor.h>
#include "ZoomTool.h"
#include "KoZoomTool.h"
ZoomTool::ZoomTool(KoCanvasBase *canvas)
KoZoomTool::KoZoomTool(KoCanvasBase *canvas)
: super(canvas)
{
setObjectName("tool_zoom");
......@@ -47,11 +47,11 @@ ZoomTool::ZoomTool(KoCanvasBase *canvas)
connect(&m_timer, SIGNAL(timeout()), SLOT(slotTimer()));
}
ZoomTool::~ZoomTool()
KoZoomTool::~KoZoomTool()
{
}
void ZoomTool::mousePressEvent(KoPointerEvent *e)
void KoZoomTool::mousePressEvent(KoPointerEvent *e)
{
if (!m_dragging) {
if (e->button() == Qt::LeftButton) {
......@@ -62,7 +62,7 @@ void ZoomTool::mousePressEvent(KoPointerEvent *e)
}
}
void ZoomTool::mouseMoveEvent(KoPointerEvent *e)
void KoZoomTool::mouseMoveEvent(KoPointerEvent *e)
{
if (m_dragging) {
QRectF bound;
......@@ -75,7 +75,7 @@ void ZoomTool::mouseMoveEvent(KoPointerEvent *e)
}
}
void ZoomTool::mouseReleaseEvent(KoPointerEvent *e)
void KoZoomTool::mouseReleaseEvent(KoPointerEvent *e)
{
if (m_dragging && e->button() == Qt::LeftButton) {
m_endPos = e->pos();
......@@ -95,23 +95,23 @@ void ZoomTool::mouseReleaseEvent(KoPointerEvent *e)
*/ }
}
void ZoomTool::mouseDoubleClickEvent(KoPointerEvent *e)
void KoZoomTool::mouseDoubleClickEvent(KoPointerEvent *e)
{
}
void ZoomTool::activate()
void KoZoomTool::activate()
{
super::activate();
m_timer.start(50);
}
void ZoomTool::deactivate()
void KoZoomTool::deactivate()
{
m_timer.stop();
}
void ZoomTool::slotTimer()
void KoZoomTool::slotTimer()
{
/* int state = QApplication::keyboardModifiers() & (Qt::ShiftModifier|Qt::ControlModifier|Qt::AltModifier);
......@@ -124,9 +124,9 @@ void ZoomTool::slotTimer()
}
void ZoomTool::paint(QPainter &painter, KoViewConverter &converter)
void KoZoomTool::paint(QPainter &painter, KoViewConverter &converter)
{
if (m_canvas) {
if (m_canvas && m_dragging) {
QPen old = painter.pen();
QPen pen(Qt::DotLine);
QPoint start;
......@@ -139,4 +139,4 @@ void ZoomTool::paint(QPainter &painter, KoViewConverter &converter)
}
}
#include "ZoomTool.moc"
#include "KoZoomTool.moc"
......@@ -26,14 +26,14 @@
#include <KoToolFactory.h>
class ZoomTool : public KoTool {
class KoZoomTool : public KoTool {
typedef KoTool super;
Q_OBJECT
public:
ZoomTool(KoCanvasBase *canvas);
virtual ~ZoomTool();
KoZoomTool(KoCanvasBase *canvas);
virtual ~KoZoomTool();
public:
virtual void mousePressEvent(KoPointerEvent *event);
......@@ -60,11 +60,11 @@ private:
};
class ZoomToolFactory : public KoToolFactory {
class KoZoomToolFactory : public KoToolFactory {
public:
ZoomToolFactory(QObject *parent)
: KoToolFactory(parent, "KritaView/ZoomTool", i18n( "Zoom tool") )
KoZoomToolFactory(QObject *parent)
: KoToolFactory(parent, "KritaView/KoZoomTool", i18n( "Zoom tool") )
{
setToolTip( i18n( "Zoom" ) );
//setToolType( TOOL_TYPE_VIEW );
......@@ -75,10 +75,10 @@ public:
// setShortcut( KShortcut( Qt:Key_Z ) );
}
virtual ~ZoomToolFactory(){}
virtual ~KoZoomToolFactory(){}
virtual KoTool * createTool(KoCanvasBase *canvas) {
return new ZoomTool(canvas);
return new KoZoomTool(canvas);
}
};
......
......@@ -8,7 +8,6 @@ SET ( defaulttools_SRCS
Plugin.cpp
ConnectionTool.cpp
ConnectionToolFactory.cpp
ZoomTool.cpp
)
#kde4_add_ui_files(defaulttools_SRCS
......
......@@ -18,7 +18,6 @@
*/
#include "Plugin.h"
#include "ConnectionToolFactory.h"
#include "ZoomTool.h"
#include <KoShapeRegistry.h>
#include <KoToolRegistry.h>
......@@ -31,7 +30,6 @@ Plugin::Plugin(QObject * parent, const QStringList &)
: QObject(parent)
{
KoToolRegistry::instance()->add(new ConnectionToolFactory(parent));
KoToolRegistry::instance()->add(new ZoomToolFactory(parent));
}
#include "Plugin.moc"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment