Small tweaks to Insight hex viewer address labels

This commit is contained in:
Nav
2022-04-03 17:00:28 +01:00
parent 81ff76a1a3
commit a0c493abaa
4 changed files with 5 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ namespace Bloom::Widgets
void ByteAddressContainer::adjustAddressLabels( void ByteAddressContainer::adjustAddressLabels(
const std::map<std::size_t, std::vector<ByteItem*>>& byteItemsByRowIndex const std::map<std::size_t, std::vector<ByteItem*>>& byteItemsByRowIndex
) { ) {
static constexpr int leftMargin = 10;
static const auto margins = QMargins(0, 10, 0, 0); static const auto margins = QMargins(0, 10, 0, 0);
const auto newRowCount = byteItemsByRowIndex.size(); const auto newRowCount = byteItemsByRowIndex.size();
@@ -30,7 +31,7 @@ namespace Bloom::Widgets
const auto& firstByteItem = byteItems.front(); const auto& firstByteItem = byteItems.front();
addressLabel->setAddressHex(firstByteItem->relativeAddressHex); addressLabel->setAddressHex(firstByteItem->relativeAddressHex);
addressLabel->setPos( addressLabel->setPos(
0, leftMargin,
firstByteItem->pos().y() firstByteItem->pos().y()
); );
} }

View File

@@ -15,7 +15,7 @@ namespace Bloom::Widgets
class ByteAddressContainer: public QGraphicsItem class ByteAddressContainer: public QGraphicsItem
{ {
public: public:
static constexpr int WIDTH = 85; static constexpr int WIDTH = 88;
ByteAddressContainer() = default; ByteAddressContainer() = default;

View File

@@ -26,6 +26,6 @@ namespace Bloom::Widgets
painter->setFont(font); painter->setFont(font);
painter->setPen(fontColor); painter->setPen(fontColor);
painter->drawText(widgetRect, Qt::AlignCenter, this->addressHex); painter->drawText(widgetRect, Qt::AlignLeft, this->addressHex);
} }
} }

View File

@@ -12,7 +12,7 @@ namespace Bloom::Widgets
class ByteAddressItem: public QGraphicsItem class ByteAddressItem: public QGraphicsItem
{ {
public: public:
static constexpr int WIDTH = 84; static constexpr int WIDTH = 75;
static constexpr int HEIGHT = ByteItem::HEIGHT; static constexpr int HEIGHT = ByteItem::HEIGHT;
ByteAddressItem(QGraphicsItem* parent): QGraphicsItem(parent) {}; ByteAddressItem(QGraphicsItem* parent): QGraphicsItem(parent) {};