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

@@ -31,7 +31,7 @@
#include "ComboBox.h"
#include "DataFile.h"
#include "gui_templates.h"
#include "FontHelper.h"
#include "PixmapButton.h"
#include "SampleLoader.h"
#include "Song.h"
@@ -227,7 +227,7 @@ void AudioFileProcessorView::paintEvent(QPaintEvent*)
int idx = a->sample().sampleFile().length();
p.setFont(adjustedToPixelSize(font(), 8));
p.setFont(adjustedToPixelSize(font(), SMALL_FONT_SIZE));
QFontMetrics fm(p.font());