fix weatherinfo, align text to channelname font

This commit is contained in:
TangoCash
2021-11-18 17:56:35 +01:00
committed by Thilo Graf
parent 22a39bdf9d
commit a16ef69245

View File

@@ -196,12 +196,13 @@ void CWeather::show(int x, int y)
ptmp->setColorBody(form->getColorBody()); ptmp->setColorBody(form->getColorBody());
form->addCCItem(ptmp); 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->doPaintBg(false);
temp->setTextColor(COL_INFOBAR_TEXT); temp->setTextColor(COL_INFOBAR_TEXT);
form->addCCItem(temp); 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->enableShadow();
form->paint(); form->paint();
} }