ui: graph zoom buttons
Added simple zoom buttons to graph
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user