Skip to content

Commit 6ca54ce

Browse files
committed
qt: Do not extend recent transaction width to address/label string
Github-Pull: bitcoin-core/gui#365 Rebased-From: 9ea1da6
1 parent f220368 commit 6ca54ce

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/qt/overviewpage.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,12 @@ class TxViewDelegate : public QAbstractItemDelegate
7171
painter->setPen(foreground);
7272
QRect boundingRect;
7373
painter->drawText(addressRect, Qt::AlignLeft | Qt::AlignVCenter, address, &boundingRect);
74-
int address_rect_min_width = boundingRect.width();
7574

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

8482
if(amount < 0)
@@ -107,7 +105,8 @@ class TxViewDelegate : public QAbstractItemDelegate
107105
QRect date_bounding_rect;
108106
painter->drawText(amountRect, Qt::AlignLeft | Qt::AlignVCenter, GUIUtil::dateTimeStr(date), &date_bounding_rect);
109107

110-
const int minimum_width = std::max(address_rect_min_width, amount_bounding_rect.width() + date_bounding_rect.width());
108+
// 0.4*date_bounding_rect.width() is used to visually distinguish a date from an amount.
109+
const int minimum_width = 1.4 * date_bounding_rect.width() + amount_bounding_rect.width();
111110
const auto search = m_minimum_width.find(index.row());
112111
if (search == m_minimum_width.end() || search->second != minimum_width) {
113112
m_minimum_width[index.row()] = minimum_width;

0 commit comments

Comments
 (0)