@@ -678,6 +678,16 @@ void ApplicationSettings::setLastFilepickerLocation(const FilePath& path)
|
||||
setValue<std::wstring>("user/last_filepicker_location", path.wstr());
|
||||
}
|
||||
|
||||
float ApplicationSettings::getGraphZoomLevel() const
|
||||
{
|
||||
return getValue<float>("user/graph_zoom_level", 1.0f);
|
||||
}
|
||||
|
||||
void ApplicationSettings::setGraphZoomLevel(float zoomLevel)
|
||||
{
|
||||
setValue<float>("user/graph_zoom_level", zoomLevel);
|
||||
}
|
||||
|
||||
int ApplicationSettings::getPluginPort() const
|
||||
{
|
||||
return getValue<int>("network/plugin_port", 6666);
|
||||
|
||||
@@ -181,6 +181,9 @@ public:
|
||||
FilePath getLastFilepickerLocation() const;
|
||||
void setLastFilepickerLocation(const FilePath& path);
|
||||
|
||||
float getGraphZoomLevel() const;
|
||||
void setGraphZoomLevel(float zoomLevel);
|
||||
|
||||
// network
|
||||
int getPluginPort() const;
|
||||
void setPluginPort(const int pluginPort);
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
QtGraphicsView::QtGraphicsView(GraphFocusHandler* focusHandler, QWidget* parent)
|
||||
: QGraphicsView(parent)
|
||||
, m_focusHandler(focusHandler)
|
||||
, m_zoomFactor(1.0f)
|
||||
, m_zoomFactor(ApplicationSettings::getInstance()->getGraphZoomLevel())
|
||||
, m_appZoomFactor(1.0f)
|
||||
, m_zoomInButtonSpeed(20.0f)
|
||||
, m_zoomOutButtonSpeed(-20.0f)
|
||||
@@ -835,6 +835,10 @@ void QtGraphicsView::setZoomFactor(float zoomFactor)
|
||||
{
|
||||
m_zoomFactor = zoomFactor;
|
||||
|
||||
std::shared_ptr<ApplicationSettings> settings = ApplicationSettings::getInstance();
|
||||
settings->setGraphZoomLevel(zoomFactor);
|
||||
settings->save();
|
||||
|
||||
m_zoomState->setText(QString::number(int(m_zoomFactor * 100)) + "%");
|
||||
updateTransform();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user