Commit 6c643ebc authored by Boudewijn Rempt's avatar Boudewijn Rempt

Remove the unimplemented bird's eyeview from the zoom tool

parent 71af6ece
......@@ -24,12 +24,10 @@
#include "KoZoomTool.h"
KoZoomToolWidget::KoZoomToolWidget(KoZoomTool* tool, QWidget* parent)
: QWidget(parent), m_tool(tool)
: QWidget(parent)
, m_tool(tool)
{
setupUi(this);
m_dirtyThumbnail = true;
birdEyeLabel->installEventFilter(this);
birdEyeLabel->hide(); //remove this when coding on the birdEyeLabel
zoomInButton->setIcon(koIcon("zoom-in"));
zoomOutButton->setIcon(koIcon("zoom-out"));
......@@ -44,45 +42,6 @@ KoZoomToolWidget::~KoZoomToolWidget()
{
}
void KoZoomToolWidget::paintBirdEye()
{
QPainter p;
if (m_dirtyThumbnail) {
m_thumbnail = QPixmap(birdEyeLabel->size());
// m_thumbnail.fill(birdEyeLabel->palette().dark().color());
p.begin(&m_thumbnail);
// TODO fill in code to paint a thumbnail of the current document
p.end();
m_dirtyThumbnail = false;
}
p.begin(birdEyeLabel);
p.drawPixmap(0, 0, m_thumbnail);
// p.drawRect(m_birdEyeRect);
p.end();
}
bool KoZoomToolWidget::eventFilter(QObject* object, QEvent* event)
{
if (object == birdEyeLabel) {
if (event->type() == QEvent::Paint) {
paintBirdEye();
return true;
} else if (event->type() == QEvent::MouseMove) {
QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
if (mouseEvent->buttons() | Qt::LeftButton) {
// m_tool->canvasController()->pan
// TODO implement panning
}
return true;
} else if (event->type() == QEvent::Resize) {
m_dirtyThumbnail = true;
} else
return false;
}
return QWidget::eventFilter(object, event);
}
void KoZoomToolWidget::changeZoomMode()
{
m_tool->setZoomInMode(zoomInButton->isChecked());
......
......@@ -32,18 +32,9 @@ public:
explicit KoZoomToolWidget(KoZoomTool* tool, QWidget *parent = 0);
~KoZoomToolWidget() override;
protected:
bool eventFilter(QObject *object, QEvent *event) override;
private Q_SLOTS:
void changeZoomMode();
private:
void paintBirdEye();
bool m_dirtyThumbnail;
QRect m_birdEyeRect;
QPixmap m_thumbnail;
KoZoomTool *m_tool;
};
......
......@@ -17,28 +17,11 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Zoom In</string>
<string>&amp;Zoom In</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QRadioButton" name="zoomOutButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Zoom Out</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="birdEyeLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="0">
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -51,6 +34,16 @@
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QRadioButton" name="zoomOutButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Zoo&amp;m Out</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
......
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