Raven Core  3.0.0
P2P Digital Currency
modaloverlay.h
Go to the documentation of this file.
1 // Copyright (c) 2016 The Bitcoin Core developers
2 // Copyright (c) 2017-2019 The Raven Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef RAVEN_QT_MODALOVERLAY_H
7 #define RAVEN_QT_MODALOVERLAY_H
8 
9 #include <QDateTime>
10 #include <QWidget>
11 
13 static constexpr int HEADER_HEIGHT_DELTA_SYNC = 24;
14 
15 namespace Ui {
16  class ModalOverlay;
17 }
18 
20 class ModalOverlay : public QWidget
21 {
22  Q_OBJECT
23 
24 public:
25  explicit ModalOverlay(QWidget *parent);
26  ~ModalOverlay();
27 
28 public Q_SLOTS:
29  void tipUpdate(int count, const QDateTime& blockDate, double nVerificationProgress);
30  void setKnownBestHeight(int count, const QDateTime& blockDate);
31 
32  void toggleVisibility();
33  // will show or hide the modal layer
34  void showHide(bool hide = false, bool userRequested = false);
35  void closeClicked();
36  bool isLayerVisible() const { return layerIsVisible; }
37 
38 protected:
39  bool eventFilter(QObject * obj, QEvent * ev);
40  bool event(QEvent* ev);
41 
42 private:
43  Ui::ModalOverlay *ui;
44  int bestHeaderHeight; //best known height (based on the headers)
45  QDateTime bestHeaderDate;
46  QVector<QPair<qint64, double> > blockProcessTime;
48  bool userClosed;
49 };
50 
51 #endif // RAVEN_QT_MODALOVERLAY_H
bool isLayerVisible() const
Definition: modaloverlay.h:36
Modal overlay to display information about the chain-sync state.
Definition: modaloverlay.h:20
Ui::ModalOverlay * ui
Definition: modaloverlay.h:43
QDateTime bestHeaderDate
Definition: modaloverlay.h:45
bool layerIsVisible
Definition: modaloverlay.h:47
int bestHeaderHeight
Definition: modaloverlay.h:44
QVector< QPair< qint64, double > > blockProcessTime
Definition: modaloverlay.h:46