From f625b33d56f6a0ce98f03a24bf6cad8b5624ce07 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 3 Oct 2014 12:33:03 +0200 Subject: QtBiomeVisualiser: Zoom is now limited and aligned to steps. --- Tools/QtBiomeVisualiser/MainWindow.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Tools/QtBiomeVisualiser/MainWindow.h') diff --git a/Tools/QtBiomeVisualiser/MainWindow.h b/Tools/QtBiomeVisualiser/MainWindow.h index 6490a937f..54a9cc6c7 100644 --- a/Tools/QtBiomeVisualiser/MainWindow.h +++ b/Tools/QtBiomeVisualiser/MainWindow.h @@ -39,13 +39,30 @@ private slots: /** Opens a vanilla world that is specified by the calling action. */ void openVanillaWorld(); + /** Moves the view to the map's center. */ + void centerView(); + + /** Sets the zoom level specified in the triggering action. */ + void setViewZoom(); + + /** Sets a zoom level one step larger than current, if allowed. */ + void increaseZoom(); + + /** Sets a zoom level one step smaller than current, if allowed. */ + void decreaseZoom(); + protected: + /** The zoom levels */ + static const double m_ViewZooms[10]; + // Actions: QAction * m_actNewGen; QAction * m_actOpenGen; QAction * m_actOpenWorld; QAction * m_actReload; QAction * m_actExit; + QAction * m_actViewCenter; + QAction * m_actViewZoom[ARRAYCOUNT(m_ViewZooms)]; /** List of actions that open the specific vanilla world. */ QList m_WorldActions; @@ -65,6 +82,9 @@ protected: /** The separator line between biome view and generator setup. */ QWidget * m_LineSeparator; + /** Index into m_ViewZooms[] for the current zoom level. */ + size_t m_CurrentZoomLevel; + /** Initializes the m_MinecraftPath based on the proper MC path */ void initMinecraftPath(); -- cgit v1.2.3