aboutsummaryrefslogtreecommitdiff
path: root/src/qt/transactionoverviewwidget.h
blob: 2bdead7bc40e92b5a915cb6d24046da3352d01ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (c) 2021 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef BITCOIN_QT_TRANSACTIONOVERVIEWWIDGET_H
#define BITCOIN_QT_TRANSACTIONOVERVIEWWIDGET_H

#include <qt/transactiontablemodel.h>

#include <QListView>
#include <QSize>
#include <QSizePolicy>

QT_BEGIN_NAMESPACE
class QShowEvent;
class QWidget;
QT_END_NAMESPACE

class TransactionOverviewWidget : public QListView
{
    Q_OBJECT

public:
    explicit TransactionOverviewWidget(QWidget* parent = nullptr) : QListView(parent) {}

    QSize sizeHint() const override
    {
        return {sizeHintForColumn(TransactionTableModel::ToAddress), QListView::sizeHint().height()};
    }

protected:
    void showEvent(QShowEvent* event) override
    {
        Q_UNUSED(event);
        QSizePolicy sp = sizePolicy();
        sp.setHorizontalPolicy(QSizePolicy::Minimum);
        setSizePolicy(sp);
    }
};

#endif // BITCOIN_QT_TRANSACTIONOVERVIEWWIDGET_H