Fix hardcoded fonts scaling issues (#7493)

* changed font sizes to better values

* rename gui_templates.h to FontHelper.h

* replace hardcoded values with constants

* make knob labels use small font

* code review from michael

* more consolidation

* Fix text problem in Vectorscope

Fix a problem with cutoff text in Vectorscope. During the constructor
call of `LedCheckBox` the method `LedCheckBox::onTextUpdated` is
triggered which sets a fixed size that fits the pixmap and the text.
After instantiating the two instances in `VecControlsDialog` the
constructor then set a minimum size which overrode the fixed size that
was previously set. This then led to text that was cutoff.

---------

Co-authored-by: Michael Gregorius <michael.gregorius.git@arcor.de>
This commit is contained in:
Rossmaxx
2024-09-28 13:18:02 +05:30
committed by GitHub
parent 6a7b23b278
commit 729593c022
36 changed files with 85 additions and 92 deletions

View File

@@ -25,7 +25,7 @@
#include "AudioFileProcessorWaveView.h"
#include "ConfigManager.h"
#include "gui_templates.h"
#include "FontHelper.h"
#include "SampleWaveform.h"
#include <QPainter>
@@ -279,7 +279,7 @@ void AudioFileProcessorWaveView::paintEvent(QPaintEvent * pe)
p.fillRect(s_padding, s_padding, m_graph.width(), 14, g);
p.setPen(QColor(255, 255, 255));
p.setFont(adjustedToPixelSize(font(), 8));
p.setFont(adjustedToPixelSize(font(), SMALL_FONT_SIZE));
QString length_text;
const int length = m_sample->sampleDuration().count();