Small tweaks to Insight hex viewer address labels
This commit is contained in:
@@ -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()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) {};
|
||||||
|
|||||||
Reference in New Issue
Block a user