subsurface/desktop-widgets/filterwidget2.h
Dirk Hohndel 3ff131b27d 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>
2019-02-19 12:02:58 -08:00

46 lines
838 B
C++

#ifndef FILTERWIDGET_2_H
#define FILTERWIDGET_2_H
#include <QWidget>
#include <QHideEvent>
#include <QShowEvent>
#include <memory>
#include "ui_filterwidget2.h"
#include "qt-models/filtermodels.h"
namespace Ui {
class FilterWidget2;
}
class FilterWidget2 : public QWidget {
Q_OBJECT
public:
explicit FilterWidget2(QWidget *parent = 0);
void updateFilter();
QString shownText();
protected:
void hideEvent(QHideEvent *event) override;
void showEvent(QShowEvent *event) override;
public slots:
void updatePlanned(int value);
void updateLogged(int value);
private slots:
void clearFilter();
void closeFilter();
void temperatureChanged();
void countsChanged();
private:
bool ignoreSignal;
bool isActive() const;
Ui::FilterWidget2 ui;
void filterDataChanged(const FilterData &data);
FilterData filterData;
};
#endif