Skip to content

Commit 9ea1da6

Browse files
committed
qt: Do not extend recent transaction width to address/label string
1 parent 3a2c84a commit 9ea1da6

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
@@ -72,15 +72,13 @@ class TxViewDelegate : public QAbstractItemDelegate
7272
painter->setPen(foreground);
7373
QRect boundingRect;
7474
painter->drawText(addressRect, Qt::AlignLeft | Qt::AlignVCenter, address, &boundingRect);
75-
int address_rect_min_width = boundingRect.width();
7675

7776
if (index.data(TransactionTableModel::WatchonlyRole).toBool())
7877
{
7978
QIcon iconWatchonly = qvariant_cast<QIcon>(index.data(TransactionTableModel::WatchonlyDecorationRole));
8079
QRect watchonlyRect(boundingRect.right() + 5, mainRect.top()+ypad+halfheight, 16, halfheight);
8180
iconWatchonly = platformStyle->TextColorIcon(iconWatchonly);
8281
iconWatchonly.paint(painter, watchonlyRect);
83-
address_rect_min_width += 5 + watchonlyRect.width();
8482
}
8583

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

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

0 commit comments

Comments
 (0)