ui: graph zoom buttons

Added simple zoom buttons to graph
This commit is contained in:
Manuel Dobusch
2017-01-26 16:33:49 +01:00
parent 9583b6bbea
commit cdde712a2c
4 changed files with 101 additions and 30 deletions
+15
View File
@@ -6,6 +6,8 @@
#include <QGraphicsView>
#include <QPointF>
#include <QPushButton>
#include "component/view/GraphView.h"
#include "qt/utility/QtScrollSpeedChangeListener.h"
#include "qt/utility/QtThreadedFunctor.h"
@@ -53,6 +55,11 @@ private slots:
void finishedTransition();
void clickedInEmptySpace();
void zoomInPressed();
void zoomOutPressed();
void onMouseWheelEvent(QWheelEvent* event);
private:
void switchToNewGraphData();
@@ -70,6 +77,8 @@ private:
void doFocusIn(const std::vector<Id>& tokenIds);
void doFocusOut(const std::vector<Id>& tokenIds);
void zoom(const float delta);
std::shared_ptr<QtGraphNode> findNodeRecursive(const std::list<std::shared_ptr<QtGraphNode>>& nodes, Id tokenId);
std::shared_ptr<QtGraphNode> createNodeRecursive(
@@ -118,6 +127,12 @@ private:
QtScrollSpeedChangeListener m_scrollSpeedChangeListenerHorizontal;
QtScrollSpeedChangeListener m_scrollSpeedChangeListenerVertical;
QPushButton* m_zoomInButton;
QPushButton* m_zoomOutButton;
float m_zoomInButtonSpeed;
float m_zoomOutButtonSpeed;
};
#endif // QT_GRAPH_VIEW_H