From aa91dbab6e31976b027bc03f3001b332b3b00b1f Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sat, 20 Nov 2021 18:42:49 +0100 Subject: [PATCH] fix weatherinfo, align text to channelname font Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f477d746fd91059c10517c8ae3d9fec04bc53411 Author: TangoCash Date: 2021-11-20 (Sat, 20 Nov 2021) --- 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 a62042ea8..6bbac9471 100644 --- a/src/gui/weather.cpp +++ b/src/gui/weather.cpp @@ -197,12 +197,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(); }