Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
modaloverlay.h
Go to the documentation of this file.
1// Copyright (c) 2016 The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_QT_MODALOVERLAY_H
6#define BITCOIN_QT_MODALOVERLAY_H
7
8#include <QDateTime>
9#include <QPropertyAnimation>
10#include <QWidget>
11
14static constexpr int HEADER_HEIGHT_DELTA_SYNC = 24;
15
16namespace Ui {
17class ModalOverlay;
18}
19
21class ModalOverlay : public QWidget {
23
24public:
25 explicit ModalOverlay(bool enable_wallet, QWidget *parent);
27
28 void tipUpdate(int count, const QDateTime &blockDate,
31 bool presync);
32
33 // will show or hide the modal layer
34 void showHide(bool hide = false, bool userRequested = false);
35 bool isLayerVisible() const { return layerIsVisible; }
36
37public Q_SLOTS:
38 void toggleVisibility();
39 void closeClicked();
40
42 void triggered(bool hidden);
43
44protected:
45 bool eventFilter(QObject *obj, QEvent *ev) override;
46 bool event(QEvent *ev) override;
47
48private:
49 Ui::ModalOverlay *ui;
50 int bestHeaderHeight; // best known height (based on the headers)
57 void UpdateHeaderPresyncLabel(int height, const QDateTime &blockDate);
58};
59
60#endif // BITCOIN_QT_MODALOVERLAY_H
Modal overlay to display information about the chain-sync state.
void showHide(bool hide=false, bool userRequested=false)
bool event(QEvent *ev) override
Tracks parent widget changes.
void tipUpdate(int count, const QDateTime &blockDate, double nVerificationProgress)
void UpdateHeaderSyncLabel()
void toggleVisibility()
QDateTime bestHeaderDate
bool layerIsVisible
void triggered(bool hidden)
Ui::ModalOverlay * ui
bool isLayerVisible() const
void setKnownBestHeight(int count, const QDateTime &blockDate, bool presync)
QVector< QPair< qint64, double > > blockProcessTime
bool eventFilter(QObject *obj, QEvent *ev) override
void UpdateHeaderPresyncLabel(int height, const QDateTime &blockDate)
QPropertyAnimation m_animation
static constexpr int HEADER_HEIGHT_DELTA_SYNC
The required delta of headers to the estimated number of available headers until we show the IBD prog...
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition random.h:85
static int count
Definition tests.c:31