aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-06-14 23:37:40 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-07-11 12:03:12 +0300
commit6ca54ce2ae0808513172c4945e38165e766e1381 (patch)
treefc3f92bd045ad425ea016d929b95834f0b5ab8f8
parentf220368220abb11040fa944a853cda3d4f1fe84d (diff)
downloadbitcoin-6ca54ce2ae0808513172c4945e38165e766e1381.tar.xz
qt: Do not extend recent transaction width to address/label string
Github-Pull: bitcoin-core/gui#365 Rebased-From: 9ea1da6fc91e17bdaa722001b97aadf576f07f65
-rw-r--r--src/qt/overviewpage.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp
index 6a66584544..2dea4e1bd6 100644
--- a/src/qt/overviewpage.cpp
+++ b/src/qt/overviewpage.cpp
@@ -71,14 +71,12 @@ public:
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)
@@ -107,7 +105,8 @@ public:
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());
+ // 0.4*date_bounding_rect.width() is used to visually distinguish a date from an amount.
+ const int minimum_width = 1.4 * date_bounding_rect.width() + amount_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;