From a16ef692450620aa79bba0ebcf223eb188c5587c Mon Sep 17 00:00:00 2001 From: TangoCash Date: Thu, 18 Nov 2021 17:56:35 +0100 Subject: [PATCH] fix weatherinfo, align text to channelname font --- src/gui/weather.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/weather.cpp b/src/gui/weather.cpp index 0ea3a99d8..777c556ad 100644 --- a/src/gui/weather.cpp +++ b/src/gui/weather.cpp @@ -196,12 +196,13 @@ void CWeather::show(int x, int y) ptmp->setColorBody(form->getColorBody()); form->addCCItem(ptmp); - CComponentsText *temp = new CComponentsText(ptmp->getWidth() + 2*RADIUS_MID, ptmp->getHeight()/2 + RADIUS_MID - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getHeight()/2, 0, 0, getCurrentTemperature() + "°C", CTextBox::AUTO_WIDTH, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]); + CComponentsText *temp = new CComponentsText(ptmp->getWidth() + 2*RADIUS_MID, ptmp->getHeight()/2 + RADIUS_MID - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getHeight()/2, 0, 0, getCurrentTemperature() + "°C", CTextBox::AUTO_WIDTH, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]); temp->doPaintBg(false); temp->setTextColor(COL_INFOBAR_TEXT); form->addCCItem(temp); - form->setDimensionsAll(x, y, ptmp->getWidth() + temp->getWidth() + 2*RADIUS_MID, ptmp->getHeight() + 2*RADIUS_MID); + int height = std::max(ptmp->getHeight(),temp->getHeight()); + form->setDimensionsAll(x, y, ptmp->getWidth() + temp->getWidth() + 2*RADIUS_MID, height + 2*RADIUS_MID); form->enableShadow(); form->paint(); }