Skip to content

Commit d476f41

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

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/qt/overviewpage.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <QAbstractItemDelegate>
2020
#include <QApplication>
2121
#include <QDateTime>
22+
#include <QLatin1String>
2223
#include <QPainter>
2324
#include <QStatusTipEvent>
2425

@@ -72,15 +73,13 @@ class TxViewDelegate : public QAbstractItemDelegate
7273
painter->setPen(foreground);
7374
QRect boundingRect;
7475
painter->drawText(addressRect, Qt::AlignLeft | Qt::AlignVCenter, address, &boundingRect);
75-
int address_rect_min_width = boundingRect.width();
7676

7777
if (index.data(TransactionTableModel::WatchonlyRole).toBool())
7878
{
7979
QIcon iconWatchonly = qvariant_cast<QIcon>(index.data(TransactionTableModel::WatchonlyDecorationRole));
8080
QRect watchonlyRect(boundingRect.right() + 5, mainRect.top()+ypad+halfheight, 16, halfheight);
8181
iconWatchonly = platformStyle->TextColorIcon(iconWatchonly);
8282
iconWatchonly.paint(painter, watchonlyRect);
83-
address_rect_min_width += 5 + watchonlyRect.width();
8483
}
8584

8685
if(amount < 0)
@@ -107,9 +106,9 @@ class TxViewDelegate : public QAbstractItemDelegate
107106

108107
painter->setPen(option.palette.color(QPalette::Text));
109108
QRect date_bounding_rect;
110-
painter->drawText(amountRect, Qt::AlignLeft | Qt::AlignVCenter, GUIUtil::dateTimeStr(date), &date_bounding_rect);
109+
painter->drawText(amountRect, Qt::AlignLeft | Qt::AlignVCenter, GUIUtil::dateTimeStr(date) + QLatin1String(" "), &date_bounding_rect);
111110

112-
const int minimum_width = std::max(address_rect_min_width, amount_bounding_rect.width() + date_bounding_rect.width());
111+
const int minimum_width = amount_bounding_rect.width() + date_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)