File indexing completed on 2024-12-22 04:09:14

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2008 Martin Pfeiffer <hubipete@gmx.net>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 #include "KoZoomToolWidget.h"
0008 #include <QPainter>
0009 #include <QMouseEvent>
0010 #include <KoIcon.h>
0011 #include "KoZoomTool.h"
0012 
0013 KoZoomToolWidget::KoZoomToolWidget(KoZoomTool* tool, QWidget* parent)
0014     : QWidget(parent)
0015     , m_tool(tool)
0016 {
0017     setupUi(this);
0018 
0019     zoomInButton->setIcon(koIcon("zoom-in"));
0020     zoomInButton->setIconSize(QSize(22, 22));
0021     zoomOutButton->setIcon(koIcon("zoom-out"));
0022     zoomOutButton->setIconSize(QSize(22, 22));
0023 
0024     connect(zoomInButton, SIGNAL(toggled(bool)), this, SLOT(changeZoomMode()));
0025     connect(zoomOutButton, SIGNAL(toggled(bool)), this, SLOT(changeZoomMode()));
0026 
0027     zoomInButton->click();
0028 }
0029 
0030 KoZoomToolWidget::~KoZoomToolWidget()
0031 {
0032 }
0033 
0034 void KoZoomToolWidget::changeZoomMode()
0035 {
0036     m_tool->setZoomInMode(zoomInButton->isChecked());
0037 }