Tidying AnnotationItem class in prep for value annotations
This commit is contained in:
@@ -20,8 +20,8 @@ height(position == AnnotationItemPosition::TOP ? AnnotationItem::TOP_HEIGHT : An
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AnnotationItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) {
|
void AnnotationItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) {
|
||||||
static auto lineColor = this->getLineColor();
|
auto lineColor = this->getLineColor();
|
||||||
static auto labelFontColor = this->getLabelFontColor();
|
auto labelFontColor = this->getLabelFontColor();
|
||||||
|
|
||||||
const auto isEnabled = this->isEnabled();
|
const auto isEnabled = this->isEnabled();
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ namespace Bloom::Widgets
|
|||||||
const int height;
|
const int height;
|
||||||
const std::uint32_t startAddress;
|
const std::uint32_t startAddress;
|
||||||
const std::uint32_t endAddress;
|
const std::uint32_t endAddress;
|
||||||
|
const std::size_t size;
|
||||||
AnnotationItemPosition position = AnnotationItemPosition::TOP;
|
AnnotationItemPosition position = AnnotationItemPosition::TOP;
|
||||||
|
|
||||||
AnnotationItem(
|
AnnotationItem(
|
||||||
@@ -36,16 +37,14 @@ namespace Bloom::Widgets
|
|||||||
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override;
|
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
[[nodiscard]] QColor getLineColor() const {
|
QString labelText;
|
||||||
|
|
||||||
|
[[nodiscard]] virtual QColor getLineColor() const {
|
||||||
return QColor(0x4F, 0x4F, 0x4F);
|
return QColor(0x4F, 0x4F, 0x4F);
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] QColor getLabelFontColor() const {
|
[[nodiscard]] virtual QColor getLabelFontColor() const {
|
||||||
return QColor(0x8A, 0x8A, 0x8D);
|
return QColor(0x8A, 0x8A, 0x8D);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
std::size_t size = 0;
|
|
||||||
QString labelText;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user