diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 30b238d4db..ca079d9e89 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -95,17 +95,21 @@ public: // Address/Label colorForeground = qvariant_cast(indexAddress.data(Qt::ForegroundRole)); QString address = indexAddress.data(Qt::DisplayRole).toString(); - painter->setPen(colorForeground); - painter->drawText(rectBottomHalf, Qt::AlignLeft | Qt::AlignVCenter, address, &rectBounding); - int address_rect_min_width = rectBounding.width(); + // Optional Watchonly indicator + QRect addressRect{rectBottomHalf}; if (index.data(TransactionTableModel::WatchonlyRole).toBool()) { QIcon iconWatchonly = qvariant_cast(index.data(TransactionTableModel::WatchonlyDecorationRole)); - QRect rectWatchonly(rectBounding.right() + 5, rectBottomHalf.top(), 16, halfheight); - iconWatchonly.paint(painter, rectWatchonly); + QRect watchonlyRect(rectBottomHalf.left(), rectBottomHalf.top(), rectBottomHalf.height(), halfheight); + iconWatchonly.paint(painter, watchonlyRect); + addressRect.setLeft(addressRect.left() + watchonlyRect.width() + 5); } + painter->setPen(colorForeground); + painter->drawText(addressRect, Qt::AlignLeft | Qt::AlignVCenter, address, &rectBounding); + int address_rect_min_width = rectBounding.width(); + const int minimum_width = std::max(address_rect_min_width, amount_bounding_rect.width() /*+ date_bounding_rect.width() */); const auto search = m_minimum_width.find(index.row()); if (search == m_minimum_width.end() || search->second != minimum_width) {