From 22caf5bf5f0f654d9ccc3edf7440b481425a661c Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 25 Dec 2021 03:50:33 +0000 Subject: [PATCH] Used different font sizes for top and bottom annotation items --- .../HexViewerWidget/AnnotationItem.cpp | 4 ++++ .../HexViewerWidget/AnnotationItem.hpp | 3 +++ .../HexViewerWidget/ValueAnnotationItem.hpp | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.cpp index 71821211..cc66a651 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.cpp @@ -41,6 +41,10 @@ void AnnotationItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* op auto lineColor = this->getLineColor(); auto labelFontColor = this->getLabelFontColor(); + auto font = painter->font(); + font.setPixelSize(this->getLabelFontSize()); + painter->setFont(font); + const auto isEnabled = this->isEnabled(); lineColor.setAlpha(isEnabled ? 255 : 100); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.hpp index 2a6947b5..23fddad4 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.hpp @@ -57,6 +57,9 @@ namespace Bloom::Widgets [[nodiscard]] virtual QColor getLabelFontColor() const { return QColor(0x68, 0x68, 0x68); } + + [[nodiscard]] virtual int getLabelFontSize() const { + return 12; } }; } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ValueAnnotationItem.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ValueAnnotationItem.hpp index 4bd3c339..690bc31a 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ValueAnnotationItem.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ValueAnnotationItem.hpp @@ -24,6 +24,10 @@ namespace Bloom::Widgets return QColor(0x94, 0x6F, 0x30); } + [[nodiscard]] int getLabelFontSize() const override { + return 11; + } + private: static constexpr auto DEFAULT_LABEL_TEXT = "??";