summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/filterwidget2.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2019-02-18 12:47:20 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-02-19 12:02:58 -0800
commit3ff131b27dff7b0742094051f4262d2dd7d3322d (patch)
tree239798cf5499b2defd55d61571d7ff852eae86c2 /desktop-widgets/filterwidget2.cpp
parent208b3bb9af8039ef0e2fc70e0e617c24db047e5d (diff)
downloadsubsurface-3ff131b27dff7b0742094051f4262d2dd7d3322d.tar.gz
Desktop: show the filter information in the window title
Instead of using the filter widget itself to show the information how many dives are displayed, put it in the window title where it's visible even if the filter widget isn't shown. If the filter is not active, simply show the total number of dives. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/filterwidget2.cpp')
-rw-r--r--desktop-widgets/filterwidget2.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/desktop-widgets/filterwidget2.cpp b/desktop-widgets/filterwidget2.cpp
index 592f016d1..5f78d6396 100644
--- a/desktop-widgets/filterwidget2.cpp
+++ b/desktop-widgets/filterwidget2.cpp
@@ -229,8 +229,16 @@ void FilterWidget2::filterDataChanged(const FilterData &data)
void FilterWidget2::countsChanged()
{
- ui.filterText->setText(tr("%L1/%L2 shown").arg(MultiFilterSortModel::instance()->divesDisplayed)
- .arg(dive_table.nr));
+ updateWindowTitle();
+}
+
+QString FilterWidget2::shownText()
+{
+ if (isActive())
+ return tr("%L1/%L2 shown").arg(MultiFilterSortModel::instance()->divesDisplayed)
+ .arg(dive_table.nr);
+ else
+ return tr("%L1 dives").arg(dive_table.nr);
}
bool FilterWidget2::isActive() const