Used different font sizes for top and bottom annotation items

This commit is contained in:
Nav
2021-12-25 03:50:33 +00:00
parent ce39c9694c
commit 22caf5bf5f
3 changed files with 11 additions and 0 deletions

View File

@@ -41,6 +41,10 @@ void AnnotationItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* op
auto lineColor = this->getLineColor(); auto lineColor = this->getLineColor();
auto labelFontColor = this->getLabelFontColor(); auto labelFontColor = this->getLabelFontColor();
auto font = painter->font();
font.setPixelSize(this->getLabelFontSize());
painter->setFont(font);
const auto isEnabled = this->isEnabled(); const auto isEnabled = this->isEnabled();
lineColor.setAlpha(isEnabled ? 255 : 100); lineColor.setAlpha(isEnabled ? 255 : 100);

View File

@@ -57,6 +57,9 @@ namespace Bloom::Widgets
[[nodiscard]] virtual QColor getLabelFontColor() const { [[nodiscard]] virtual QColor getLabelFontColor() const {
return QColor(0x68, 0x68, 0x68); return QColor(0x68, 0x68, 0x68);
} }
[[nodiscard]] virtual int getLabelFontSize() const {
return 12;
} }
}; };
} }

View File

@@ -24,6 +24,10 @@ namespace Bloom::Widgets
return QColor(0x94, 0x6F, 0x30); return QColor(0x94, 0x6F, 0x30);
} }
[[nodiscard]] int getLabelFontSize() const override {
return 11;
}
private: private:
static constexpr auto DEFAULT_LABEL_TEXT = "??"; static constexpr auto DEFAULT_LABEL_TEXT = "??";