mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Override the MinMaxAvgWidget tool tips for the depth instance.
Add new methods to the MinMaxAvgWidget class to allow us to override the default tooltips of its min and max icons, and then uses these methods to make the tooltips for the Stats tab Depth instance more descriptive. See #521 Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
89f3532145
commit
d825d689dd
3 changed files with 14 additions and 0 deletions
|
@ -528,6 +528,8 @@ void MainTab::updateDiveInfo(int dive)
|
|||
ui.depthLimits->setMaximum(get_depth_string(stats_selection.max_depth, true));
|
||||
ui.depthLimits->setMinimum(get_depth_string(stats_selection.min_depth, true));
|
||||
ui.depthLimits->setAverage(get_depth_string(stats_selection.avg_depth, true));
|
||||
ui.depthLimits->overrideMaxToolTipText(QObject::tr("Deepest Dive"));
|
||||
ui.depthLimits->overrideMinToolTipText(QObject::tr("Shallowest Dive"));
|
||||
ui.sacLimits->setMaximum(get_volume_string(stats_selection.max_sac, true).append(tr("/min")));
|
||||
ui.sacLimits->setMinimum(get_volume_string(stats_selection.min_sac, true).append(tr("/min")));
|
||||
ui.sacLimits->setAverage(get_volume_string(stats_selection.avg_sac, true).append(tr("/min")));
|
||||
|
|
|
@ -112,6 +112,16 @@ void MinMaxAvgWidget::setMinimum(const QString &minimum)
|
|||
d->minValue->setText(minimum);
|
||||
}
|
||||
|
||||
void MinMaxAvgWidget::overrideMinToolTipText(const QString &newTip)
|
||||
{
|
||||
d->minIco->setToolTip(newTip);
|
||||
}
|
||||
|
||||
void MinMaxAvgWidget::overrideMaxToolTipText(const QString &newTip)
|
||||
{
|
||||
d->maxIco->setToolTip(newTip);
|
||||
}
|
||||
|
||||
RenumberDialog *RenumberDialog::instance()
|
||||
{
|
||||
static RenumberDialog *self = new RenumberDialog(MainWindow::instance());
|
||||
|
|
|
@ -30,6 +30,8 @@ public:
|
|||
void setMinimum(const QString &minimum);
|
||||
void setMaximum(const QString &maximum);
|
||||
void setAverage(const QString &average);
|
||||
void overrideMinToolTipText(const QString &newTip);
|
||||
void overrideMaxToolTipText(const QString &newTip);
|
||||
void clear();
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Reference in a new issue