mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: activate dragging of tooltipitem
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
a527415ac9
commit
4c227aba42
6 changed files with 32 additions and 3 deletions
|
@ -7,6 +7,7 @@
|
|||
#include "core/membuffer.h"
|
||||
#include "core/profile.h"
|
||||
#include "core/qthelper.h" // for decoMode
|
||||
#include "core/settings/qPrefDisplay.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <QApplication>
|
||||
|
@ -37,12 +38,16 @@ static QFont makeFont(double dpr)
|
|||
ToolTipItem::ToolTipItem(ChartView &view, double dpr) :
|
||||
ChartRectItem(view, ProfileZValue::ToolTipItem,
|
||||
QPen(tooltipBorderColor, tooltipBorder),
|
||||
QBrush(tooltipColor), tooltipBorderRadius),
|
||||
QBrush(tooltipColor), tooltipBorderRadius,
|
||||
true),
|
||||
font(makeFont(dpr)),
|
||||
fm(font),
|
||||
fontHeight(fm.height())
|
||||
{
|
||||
title = stringToPixmap(ProfileTranslations::tr("Information"));
|
||||
|
||||
QPointF pos = qPrefDisplay::tooltip_position();
|
||||
setPos(pos);
|
||||
}
|
||||
|
||||
QPixmap ToolTipItem::stringToPixmap(const QString &str) const
|
||||
|
@ -157,3 +162,8 @@ void ToolTipItem::update(const dive *d, double dpr, int time, const plot_info &p
|
|||
}
|
||||
setTextureDirty();
|
||||
}
|
||||
|
||||
void ToolTipItem::stopDrag(QPointF pos)
|
||||
{
|
||||
qPrefDisplay::set_tooltip_position(pos);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue