<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>src/overview.cpp</filename>
    </added>
    <added>
      <filename>src/overview.h</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,6 @@
+2008-12-17 Graeme Gott &lt;graeme@gottcode.org&gt;
+	* Add panning and zooming to overview window.
+
 2008-12-08 Frank Tetzel &lt;s1445051@mail.inf.tu-dresden.de&gt;
 	* Add keyboard shortcuts.
 	* Add ability to toggle borders.</diff>
      <filename>ChangeLog</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,7 @@
 
 #include &quot;board.h&quot;
 
+#include &quot;overview.h&quot;
 #include &quot;piece.h&quot;
 #include &quot;solver.h&quot;
 #include &quot;tile.h&quot;
@@ -98,11 +99,8 @@ Board::Board(QWidget* parent)
 	generateSuccessImage();
 
 	// Create overview dialog
-	m_overview = new QLabel(0, Qt::Tool);
-	m_overview-&gt;setWindowTitle(tr(&quot;Overview&quot;));
-	m_overview-&gt;setAlignment(Qt::AlignCenter);
-	m_overview-&gt;installEventFilter(this);
-	m_overview-&gt;move(QSettings().value(&quot;Overview/Position&quot;).toPoint());
+	m_overview = new Overview;
+	connect(m_overview, SIGNAL(toggled(bool)), this, SIGNAL(overviewToggled(bool)));
 }
 
 /*****************************************************************************/
@@ -645,33 +643,6 @@ void Board::paintGL()
 
 /*****************************************************************************/
 
-bool Board::eventFilter(QObject* watched, QEvent* event)
-{
-	if (watched == m_overview) {
-		if (event-&gt;type() == QEvent::Hide) {
-			emit overviewHidden();
-		} else if (event-&gt;type() == QEvent::Show) {
-			emit overviewShown();
-		} else if (event-&gt;type() == QEvent::KeyPress) {
-			if (static_cast&lt;QKeyEvent*&gt;(event)-&gt;key() == Qt::Key_Tab)
-				m_overview-&gt;hide();
-		}
-		return false;
-	} else {
-		return QGLWidget::eventFilter(watched, event);
-	}
-}
-
-/*****************************************************************************/
-
-void Board::hideEvent(QHideEvent* event)
-{
-	QSettings().setValue(&quot;Overview/Position&quot;, m_overview-&gt;pos());
-	QGLWidget::hideEvent(event);
-}
-
-/*****************************************************************************/
-
 void Board::keyPressEvent(QKeyEvent* event)
 {
 	int offset = (event-&gt;modifiers() &amp; Qt::ControlModifier) ? 1 : 10;
@@ -1061,13 +1032,7 @@ void Board::loadImage()
 	m_image = bindTexture(texture.mirrored(false, true));
 
 	// Create overview
-	QPixmap overview = QPixmap::fromImage(texture.copy(0, 0, m_image_width, m_image_height), Qt::AutoColor | Qt::AvoidDither);
-	if (overview.width() &gt; 400 || overview.height() &gt; 400) {
-		overview = overview.scaled(400, 400, Qt::KeepAspectRatio, Qt::SmoothTransformation);
-	}
-	m_overview-&gt;setPixmap(overview);
-	m_overview-&gt;setMinimumSize(overview.size());
-	m_overview-&gt;resize(overview.size());
+	m_overview-&gt;load(texture.copy(0, 0, m_image_width, m_image_height));
 
 	// Create corners
 	m_corners[0][0] = QPointF(0,0);</diff>
      <filename>src/board.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,7 @@
 
 #include &lt;QGLWidget&gt;
 #include &lt;QHash&gt;
-class QLabel;
+class Overview;
 class Piece;
 class Tile;
 
@@ -60,8 +60,7 @@ public slots:
 	void toggleBorders();
 
 signals:
-	void overviewShown();
-	void overviewHidden();
+	void overviewToggled(bool visible);
 	void bordersToggled(bool visible);
 	void statusMessage(const QString&amp; message);
 	void retrievePiecesAvailable(bool available);
@@ -75,8 +74,6 @@ protected:
 	virtual void initializeGL();
 	virtual void resizeGL(int w, int h);
 	virtual void paintGL();
-	virtual bool eventFilter(QObject* watched, QEvent* event);
-	virtual void hideEvent(QHideEvent* event);
 	virtual void keyPressEvent(QKeyEvent* event);
 	virtual void keyReleaseEvent(QKeyEvent* event);
 	virtual void mousePressEvent(QMouseEvent* event);
@@ -115,7 +112,7 @@ private:
 	int m_image_width;
 	int m_image_height;
 	int m_tile_size;
-	QLabel* m_overview;
+	Overview* m_overview;
 
 	GLuint m_success;
 	GLuint m_image;</diff>
      <filename>src/board.h</filename>
    </modified>
    <modified>
      <diff>@@ -94,8 +94,7 @@ Window::Window()
 	// Add contents
 	m_board = new Board(this);
 	connect(m_board, SIGNAL(statusMessage(const QString&amp;)), status_message, SLOT(setText(const QString&amp;)));
-	connect(m_board, SIGNAL(overviewShown()), this, SLOT(overviewShown()));
-	connect(m_board, SIGNAL(overviewHidden()), this, SLOT(overviewHidden()));
+	connect(m_board, SIGNAL(overviewToggled(bool)), this, SLOT(overviewToggled(bool)));
 	connect(m_board, SIGNAL(bordersToggled(bool)), this, SLOT(bordersToggled(bool)));
 	connect(m_board, SIGNAL(finished()), this, SLOT(gameFinished()));
 	connect(m_board, SIGNAL(zoomChanged(int)), m_slider, SLOT(setValue(int)));
@@ -242,16 +241,13 @@ void Window::gameFinished()
 
 /*****************************************************************************/
 
-void Window::overviewShown()
+void Window::overviewToggled(bool visible)
 {
-	m_toggle_overview_action-&gt;setText(tr(&quot;Hide O&amp;verview&quot;));
-}
-
-/*****************************************************************************/
-
-void Window::overviewHidden()
-{
-	m_toggle_overview_action-&gt;setText(tr(&quot;Show O&amp;verview&quot;));
+	if (visible) {
+		m_toggle_overview_action-&gt;setText(tr(&quot;Hide O&amp;verview&quot;));
+	} else {
+		m_toggle_overview_action-&gt;setText(tr(&quot;Show O&amp;verview&quot;));
+	}
 }
 
 /*****************************************************************************/</diff>
      <filename>src/window.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -58,8 +58,7 @@ private slots:
 	void newGame();
 	void openGame();
 	void gameFinished();
-	void overviewShown();
-	void overviewHidden();
+	void overviewToggled(bool visible);
 	void bordersToggled(bool visible);
 	void setFullScreen(bool enable);
 	void showControls();</diff>
      <filename>src/window.h</filename>
    </modified>
    <modified>
      <diff>@@ -24,6 +24,7 @@ HEADERS = src/board.h \
 	src/label_manager.h \
 	src/new_game_dialog.h \
 	src/open_game_dialog.h \
+	src/overview.h \
 	src/piece.h \
 	src/solver.h \
 	src/tile.h \
@@ -40,6 +41,7 @@ SOURCES = src/board.cpp \
 	src/main.cpp \
 	src/new_game_dialog.cpp \
 	src/open_game_dialog.cpp \
+	src/overview.cpp \
 	src/piece.cpp \
 	src/solver.cpp \
 	src/tile.cpp \</diff>
      <filename>tetzle.pro</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>42d5c9d1a465d8c09c87141d5d78e5c884152882</id>
    </parent>
  </parents>
  <author>
    <name>Graeme Gott</name>
    <email>graeme@gottcode.org</email>
  </author>
  <url>http://github.com/gottcode/tetzle/commit/0fc322c5d48a6845e7626938732dfa4a531814b2</url>
  <id>0fc322c5d48a6845e7626938732dfa4a531814b2</id>
  <committed-date>2008-12-17T07:18:55-08:00</committed-date>
  <authored-date>2008-12-17T07:18:55-08:00</authored-date>
  <message>Add panning and zooming to overview window.</message>
  <tree>ee0b1bbcd46fc7d32ec229a97f5677443628f38f</tree>
  <committer>
    <name>Graeme Gott</name>
    <email>graeme@gottcode.org</email>
  </committer>
</commit>
