Skip to content

Commit

Permalink
Fix auto resize overviewpage at long tx and update webseite URL
Browse files Browse the repository at this point in the history
Fix qt auto resize overviewpage at long tx with many addresses and update webseite URL.
  • Loading branch information
mraksoll4 committed May 16, 2021
1 parent 950721e commit 8ea47be
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 95 deletions.
2 changes: 1 addition & 1 deletion build_msvc/bitcoin_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
#define PACKAGE_TARNAME "bitweb"

/* Define to the home page for this package. */
#define PACKAGE_URL "http://www.bitwebcore.info/"
#define PACKAGE_URL "https://bitwebcore.org/"

/* Define to the version of this package. */
#define PACKAGE_VERSION "0.21.1"
Expand Down
1 change: 0 additions & 1 deletion build_msvc/libbitcoin_qt/libbitcoin_qt.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@
<ClCompile Include="$(GeneratedFilesOutDir)\moc\moc_transactiondesc.cpp" />
<ClCompile Include="$(GeneratedFilesOutDir)\moc\moc_transactiondescdialog.cpp" />
<ClCompile Include="$(GeneratedFilesOutDir)\moc\moc_transactionfilterproxy.cpp" />
<ClCompile Include="$(GeneratedFilesOutDir)\moc\moc_transactionoverviewwidget.cpp" />
<ClCompile Include="$(GeneratedFilesOutDir)\moc\moc_transactionrecord.cpp" />
<ClCompile Include="$(GeneratedFilesOutDir)\moc\moc_transactiontablemodel.cpp" />
<ClCompile Include="$(GeneratedFilesOutDir)\moc\moc_transactionview.cpp" />
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2020)
define(_COPYRIGHT_HOLDERS,[The %s developers])
define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[Bitweb Core]])
AC_INIT([Bitweb Core],m4_join([.], _CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MINOR, _CLIENT_VERSION_REVISION, m4_if(_CLIENT_VERSION_BUILD, [0], [], _CLIENT_VERSION_BUILD))m4_if(_CLIENT_VERSION_RC, [0], [], [rc]_CLIENT_VERSION_RC),[https://github.com/SACSaveCoin/bitweb/issues],[bitweb],[http://www.bitwebcore.info/])
AC_INIT([Bitweb Core],m4_join([.], _CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MINOR, _CLIENT_VERSION_REVISION, m4_if(_CLIENT_VERSION_BUILD, [0], [], _CLIENT_VERSION_BUILD))m4_if(_CLIENT_VERSION_RC, [0], [], [rc]_CLIENT_VERSION_RC),[https://github.com/SACSaveCoin/bitweb/issues],[bitweb],[https://bitwebcore.org/])
AC_CONFIG_SRCDIR([src/validation.cpp])
AC_CONFIG_HEADERS([src/config/bitcoin-config.h])
AC_CONFIG_AUX_DIR([build-aux])
Expand Down
4 changes: 2 additions & 2 deletions contrib/verifybinaries/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ TMPFILE="hashes.tmp"

SIGNATUREFILENAME="SHA256SUMS.asc"
RCSUBDIR="test"
HOST1="http://www.bitwebcore.info"
HOST2="http://www.bitwebcore.info"
HOST1="https://bitwebcore.org"
HOST2="https://bitwebcore.org"
BASEDIR="/bin/"
VERSIONPREFIX="bitcoin-core-"
RCVERSIONSTRING="rc"
Expand Down
2 changes: 1 addition & 1 deletion doc/README_windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ However, it downloads and stores the entire history of Bitweb transactions;
depending on the speed of your computer and network connection, the synchronization
process can take anywhere from a few hours to a day or more.

Official Website http://www.bitwebcore.info/
Official Website https://bitwebcore.org/
Official Reposotory https://github.com/SACSaveCoin/bitweb
2 changes: 1 addition & 1 deletion doc/man/bitweb-cli.1
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Copyright (C) 2009-2020 The Bitcoin Core developers
Copyright (C) 2021-2022 The Bitweb Core developers

Please contribute if you find Bitweb Core useful. Visit
<http://www.bitwebcore.info/> for further information about the software.
<https://bitwebcore.org/> for further information about the software.
The source code is available from <https://github.com/SACSaveCoin/bitweb>.

This is experimental software.
Expand Down
2 changes: 1 addition & 1 deletion doc/man/bitweb-qt.1
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ Copyright (C) 2009-2020 The Bitcoin Core developers
Copyright (C) 2021-2022 The Bitweb Core developers

Please contribute if you find Bitweb Core useful. Visit
<http://www.bitwebcore.info/> for further information about the software.
<https://bitwebcore.org/> for further information about the software.
The source code is available from <https://github.com/SACSaveCoin/bitweb>.

This is experimental software.
Expand Down
2 changes: 1 addition & 1 deletion doc/man/bitweb-tx.1
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ Copyright (C) 2009-2020 The Bitcoin Core developers
Copyright (C) 2021-2022 The Bitweb Core developers

Please contribute if you find Bitweb Core useful. Visit
<http://www.bitwebcore.info/> for further information about the software.
<https://bitwebcore.org/> for further information about the software.
The source code is available from <https://github.com/SACSaveCoin/bitweb>.

This is experimental software.
Expand Down
2 changes: 1 addition & 1 deletion doc/man/bitweb-wallet.1
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Copyright (C) 2009-2020 The Bitcoin Core developers
Copyright (C) 2021-2022 The Bitweb Core developers

Please contribute if you find Bitweb Core useful. Visit
<http://www.bitwebcore.info/> for further information about the software.
<https://bitwebcore.org/> for further information about the software.
The source code is available from <https://github.com/SACSaveCoin/bitweb>.

This is experimental software.
Expand Down
2 changes: 1 addition & 1 deletion doc/man/bitwebd.1
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ Copyright (C) 2009-2020 The Bitcoin Core developers
Copyright (C) 2021-2022 The Bitweb Core developers

Please contribute if you find Bitweb Core useful. Visit
<http://www.bitwebcore.info/> for further information about the software.
<https://bitwebcore.org/> for further information about the software.
The source code is available from <https://github.com/SACSaveCoin/bitweb>.

This is experimental software.
Expand Down
2 changes: 0 additions & 2 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ QT_MOC_CPP = \
qt/moc_transactiondesc.cpp \
qt/moc_transactiondescdialog.cpp \
qt/moc_transactionfilterproxy.cpp \
qt/moc_transactionoverviewwidget.cpp \
qt/moc_transactiontablemodel.cpp \
qt/moc_transactionview.cpp \
qt/moc_utilitydialog.cpp \
Expand Down Expand Up @@ -152,7 +151,6 @@ BITCOIN_QT_H = \
qt/transactiondesc.h \
qt/transactiondescdialog.h \
qt/transactionfilterproxy.h \
qt/transactionoverviewwidget.h \
qt/transactionrecord.h \
qt/transactiontablemodel.h \
qt/transactionview.h \
Expand Down
15 changes: 1 addition & 14 deletions src/qt/forms/overviewpage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@
</layout>
</item>
<item>
<widget class="TransactionOverviewWidget" name="listTransactions">
<widget class="QListView" name="listTransactions">
<property name="styleSheet">
<string notr="true">QListView { background: transparent; }</string>
</property>
Expand All @@ -539,15 +539,9 @@
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustToContents</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::NoSelection</enum>
</property>
<property name="uniformItemSizes">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
Expand All @@ -572,13 +566,6 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>TransactionOverviewWidget</class>
<extends>QListView</extends>
<header>qt/transactionoverviewwidget.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../bitcoin.qrc"/>
</resources>
Expand Down
32 changes: 5 additions & 27 deletions src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <qt/optionsmodel.h>
#include <qt/platformstyle.h>
#include <qt/transactionfilterproxy.h>
#include <qt/transactionoverviewwidget.h>
#include <qt/transactiontablemodel.h>
#include <qt/walletmodel.h>

Expand All @@ -37,7 +36,6 @@ class TxViewDelegate : public QAbstractItemDelegate
QAbstractItemDelegate(parent), unit(BitcoinUnits::BTE),
platformStyle(_platformStyle)
{
connect(this, &TxViewDelegate::width_changed, this, &TxViewDelegate::sizeHintChanged);
}

inline void paint(QPainter *painter, const QStyleOptionViewItem &option,
Expand Down Expand Up @@ -71,14 +69,12 @@ class TxViewDelegate : public QAbstractItemDelegate
painter->setPen(foreground);
QRect boundingRect;
painter->drawText(addressRect, Qt::AlignLeft | Qt::AlignVCenter, address, &boundingRect);
int address_rect_min_width = boundingRect.width();

if (index.data(TransactionTableModel::WatchonlyRole).toBool())
{
QIcon iconWatchonly = qvariant_cast<QIcon>(index.data(TransactionTableModel::WatchonlyDecorationRole));
QRect watchonlyRect(boundingRect.right() + 5, mainRect.top()+ypad+halfheight, 16, halfheight);
iconWatchonly.paint(painter, watchonlyRect);
address_rect_min_width += 5 + watchonlyRect.width();
}

if(amount < 0)
Expand All @@ -100,39 +96,21 @@ class TxViewDelegate : public QAbstractItemDelegate
amountText = QString("[") + amountText + QString("]");
}

QRect amount_bounding_rect;
painter->drawText(amountRect, Qt::AlignRight | Qt::AlignVCenter, amountText, &amount_bounding_rect);
painter->drawText(amountRect, Qt::AlignRight | Qt::AlignVCenter, amountText);

painter->setPen(option.palette.color(QPalette::Text));
QRect date_bounding_rect;
painter->drawText(amountRect, Qt::AlignLeft | Qt::AlignVCenter, GUIUtil::dateTimeStr(date), &date_bounding_rect);

const int minimum_width = std::max(address_rect_min_width, amount_bounding_rect.width() + date_bounding_rect.width());
const auto search = m_minimum_width.find(index.row());
if (search == m_minimum_width.end() || search->second != minimum_width) {
m_minimum_width[index.row()] = minimum_width;
Q_EMIT width_changed(index);
}
painter->drawText(amountRect, Qt::AlignLeft | Qt::AlignVCenter, GUIUtil::dateTimeStr(date));

painter->restore();
}

inline QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
{
const auto search = m_minimum_width.find(index.row());
const int minimum_text_width = search == m_minimum_width.end() ? 0 : search->second;
return {DECORATION_SIZE + 8 + minimum_text_width, DECORATION_SIZE};
return QSize(DECORATION_SIZE, DECORATION_SIZE);
}

int unit;

Q_SIGNALS:
//! An intermediate signal for emitting from the `paint() const` member function.
void width_changed(const QModelIndex& index) const;

private:
const PlatformStyle* platformStyle;
mutable std::map<int, int> m_minimum_width;
const PlatformStyle *platformStyle;
};

#include <qt/overviewpage.moc>
Expand Down Expand Up @@ -160,7 +138,7 @@ OverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent)
ui->listTransactions->setMinimumHeight(NUM_ITEMS * (DECORATION_SIZE + 2));
ui->listTransactions->setAttribute(Qt::WA_MacShowFocusRect, false);

connect(ui->listTransactions, &TransactionOverviewWidget::clicked, this, &OverviewPage::handleTransactionClicked);
connect(ui->listTransactions, &QListView::clicked, this, &OverviewPage::handleTransactionClicked);

// start with displaying the "out of sync" warnings
showOutOfSyncWarning(true);
Expand Down
41 changes: 0 additions & 41 deletions src/qt/transactionoverviewwidget.h

This file was deleted.

0 comments on commit 8ea47be

Please sign in to comment.