summaryrefslogtreecommitdiffstats
path: root/profile-widget/divetooltipitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'profile-widget/divetooltipitem.cpp')
-rw-r--r--profile-widget/divetooltipitem.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/profile-widget/divetooltipitem.cpp b/profile-widget/divetooltipitem.cpp
index 09719c0ec..d1bda0a01 100644
--- a/profile-widget/divetooltipitem.cpp
+++ b/profile-widget/divetooltipitem.cpp
@@ -4,8 +4,8 @@
#include "core/profile.h"
#include "core/membuffer.h"
#include "core/metrics.h"
+#include "core/settings/qPrefDisplay.h"
#include <QPropertyAnimation>
-#include <QSettings>
#include <QGraphicsView>
#include <QStyleOptionGraphicsItem>
#include "core/qthelper.h"
@@ -61,7 +61,7 @@ void ToolTipItem::collapse()
{
int dim = defaultIconMetrics().sz_small;
- if (prefs.animation_speed) {
+ if (qPrefDisplay::animation_speed()) {
QPropertyAnimation *animation = new QPropertyAnimation(this, "rect");
animation->setDuration(100);
animation->setStartValue(nextRectangle);
@@ -119,7 +119,7 @@ void ToolTipItem::expand()
nextRectangle.setHeight(height);
if (nextRectangle != rect()) {
- if (prefs.animation_speed) {
+ if (qPrefDisplay::animation_speed()) {
QPropertyAnimation *animation = new QPropertyAnimation(this, "rect", this);
animation->setDuration(prefs.animation_speed);
animation->setStartValue(rect());
@@ -206,17 +206,12 @@ void ToolTipItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio
void ToolTipItem::persistPos()
{
- QSettings s;
- s.beginGroup("ProfileMap");
- s.setValue("tooltip_position", pos());
- s.endGroup();
+ qPrefDisplay::set_tooltip_position(pos());
}
void ToolTipItem::readPos()
{
- QSettings s;
- s.beginGroup("ProfileMap");
- QPointF value = s.value("tooltip_position").toPoint();
+ QPointF value = qPrefDisplay::tooltip_position();
if (!scene()->sceneRect().contains(value)) {
value = QPointF(0, 0);
}