From a09e8c51b81ad4de6803163f3a7ce18b949bef39 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Mon, 16 Aug 2021 21:51:45 -0700 Subject: [PATCH] Better meter fonts --- meter.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/meter.cpp b/meter.cpp index 07320ad..07494d2 100644 --- a/meter.cpp +++ b/meter.cpp @@ -86,20 +86,22 @@ void meter::paintEvent(QPaintEvent *) // The end effect, is that the drawing functions will all // scale to the window size. - painter.setWindow(QRect(0, 0, 255+mXstart, widgetWindowHeight)); + //painter.setWindow(QRect(0, 0, 255+mXstart, widgetWindowHeight)); - if(this->height() > widgetWindowHeight ) - { + //if(this->height() > widgetWindowHeight ) + //{ // Clamp down on stretching fonts. // TODO: Make this more elegant - painter.setFont(QFont(this->fontInfo().family(), widgetWindowHeight/3.5)); +// painter.setFont(QFont(this->fontInfo().family(), widgetWindowHeight/3.5)); + + painter.setFont(QFont(this->fontInfo().family(), fontSize)); widgetWindowHeight = this->height(); - painter.setWindow(QRect(0, 0, 255+mXstart, widgetWindowHeight)); + painter.setWindow(QRect(0, 0, 255+mXstart+15, widgetWindowHeight)); barHeight = widgetWindowHeight / 2; //painter.setFont(QFont(this->fontInfo().family(), widgetWindowHeight/2.5)); - } + //} switch(meterType) {