@@ -71,20 +71,18 @@ class TxViewDelegate : public QAbstractItemDelegate
7171 foreground = brush.color ();
7272 }
7373
74- painter->setPen (foreground);
75- QRect boundingRect;
76- painter->drawText (addressRect, Qt::AlignLeft | Qt::AlignVCenter, address, &boundingRect);
77- int address_rect_min_width = boundingRect.width ();
78-
79- if (index.data (TransactionTableModel::WatchonlyRole).toBool ())
80- {
74+ if (index.data (TransactionTableModel::WatchonlyRole).toBool ()) {
8175 QIcon iconWatchonly = qvariant_cast<QIcon>(index.data (TransactionTableModel::WatchonlyDecorationRole));
82- QRect watchonlyRect (boundingRect. right () + 5 , mainRect .top ()+ypad+halfheight , 16 , halfheight );
76+ QRect watchonlyRect (addressRect. left (), addressRect .top (), 16 , addressRect. height () );
8377 iconWatchonly = platformStyle->TextColorIcon (iconWatchonly);
8478 iconWatchonly.paint (painter, watchonlyRect);
85- address_rect_min_width += 5 + watchonlyRect.width ();
79+ addressRect. setLeft (addressRect. left () + watchonlyRect.width () + 5 );
8680 }
8781
82+ painter->setPen (foreground);
83+ QRect boundingRect;
84+ painter->drawText (addressRect, Qt::AlignLeft | Qt::AlignVCenter, address, &boundingRect);
85+
8886 if (amount < 0 )
8987 {
9088 foreground = COLOR_NEGATIVE;
@@ -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