X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Frs_actionzoomin.cpp;h=dd3715934dbb4ac91318a1be4bf9887a3623ae91;hb=be33e866f2121c48db93e06d743c5ae3826c1948;hp=d0db01f1650b6f6ad131acfcd380aaf1426434ed;hpb=16ce54abf01ca3032e42a5bb11a4afcf9014dcca;p=architektonas diff --git a/src/actions/rs_actionzoomin.cpp b/src/actions/rs_actionzoomin.cpp index d0db01f..dd37159 100644 --- a/src/actions/rs_actionzoomin.cpp +++ b/src/actions/rs_actionzoomin.cpp @@ -14,15 +14,15 @@ #include "rs_actionzoomin.h" +#include "graphicview.h" + /** * Default constructor. * * @param direction In for zooming in, Out for zooming out. * @param axis Axis that are affected by the zoom (OnlyX, OnlyY or Both) */ -RS_ActionZoomIn::RS_ActionZoomIn(RS_EntityContainer& container, - RS_GraphicView& graphicView, RS2::ZoomDirection direction, - RS2::Axis axis, const Vector& center): +RS_ActionZoomIn::RS_ActionZoomIn(RS_EntityContainer & container, GraphicView & graphicView, RS2::ZoomDirection direction, RS2::Axis axis, const Vector & center): RS_ActionInterface("Zoom in", container, graphicView) { this->direction = direction; @@ -30,26 +30,8 @@ RS_ActionZoomIn::RS_ActionZoomIn(RS_EntityContainer& container, this->center = center; } -QAction * RS_ActionZoomIn::createGUIAction(RS2::ActionType type, QObject * /*parent*/) +RS_ActionZoomIn::~RS_ActionZoomIn() { - QAction * action; - - if (type == RS2::ActionZoomIn) - { - action = new QAction(QIcon(":/res/zoomin.png"), tr("Zoom &In"), 0); -// action = new QAction(tr("Zoom in"), QPixmap::fromMimeSource("zoomin.png"), -// tr("Zoom &In"), QKeySequence(), NULL); - action->setStatusTip(tr("Zooms in")); - } - else - { - action = new QAction(QIcon(":/res/zoomout.png"), tr("Zoom &Out"), 0); -// action = new QAction(tr("Zoom out"), QPixmap::fromMimeSource("zoomout.png"), -// tr("Zoom &Out"), QKeySequence(), NULL); - action->setStatusTip(tr("Zooms out")); - } - - return action; } void RS_ActionZoomIn::init(int status) @@ -63,36 +45,27 @@ void RS_ActionZoomIn::trigger() switch (axis) { case RS2::OnlyX: + if (direction == RS2::In) - { graphicView->zoomInX(); - } else - { graphicView->zoomOutX(); - } break; case RS2::OnlyY: + if (direction == RS2::In) - { graphicView->zoomInY(); - } else - { graphicView->zoomOutY(); - } break; case RS2::Both: + if (direction == RS2::In) - { graphicView->zoomIn(1.25, center); - } else - { graphicView->zoomOut(1.25, center); - } break; }