From 7e84f49f268b3a29e4929d93da8312b0331fbe6e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 16 Nov 2022 22:50:51 +0100 Subject: [PATCH] pipsetup: use OFFSET defines Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9dd6f870975e912e0a5ea0a78add34749037cf50 Author: vanhofen Date: 2022-11-16 (Wed, 16 Nov 2022) Origin message was: ------------------ - pipsetup: use OFFSET defines ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/pipsetup.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/gui/pipsetup.cpp b/src/gui/pipsetup.cpp index 153b28ed1..ce038551c 100644 --- a/src/gui/pipsetup.cpp +++ b/src/gui/pipsetup.cpp @@ -232,9 +232,12 @@ void CPipSetup::paint() sprintf(hpos, "H: %d", height); int mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - int mwidth = 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("W: 9999"); - int x = (frameBuffer->getScreenWidth() - mwidth) / 2; - int y = (frameBuffer->getScreenHeight() - mheight * 4) / 2; + int mwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("W: 9999"); + + int w = mwidth + 2 * OFFSET_INNER_MID; + int h = mheight * 4; + int x = (frameBuffer->getScreenWidth() - w) / 2; + int y = (frameBuffer->getScreenHeight() - h) / 2; if (pipVideoDecoder[0] != NULL) { @@ -242,12 +245,12 @@ void CPipSetup::paint() frameBuffer->paintBoxRel(x_coord, y_coord, width, height, COL_MENUCONTENT_PLUS_0); } - frameBuffer->paintBoxRel(x, y, mwidth, mheight * 4, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, y, w, h, COL_MENUCONTENT_PLUS_0); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + 5, y + mheight, mwidth, xpos, COL_MENUCONTENT_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + 5, y + mheight * 2, mwidth, ypos, COL_MENUCONTENT_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + 5, y + mheight * 3, mwidth, wpos, COL_MENUCONTENT_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + 5, y + mheight * 4, mwidth, hpos, COL_MENUCONTENT_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID, y + mheight, mwidth, xpos, COL_MENUCONTENT_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID, y + mheight * 2, mwidth, ypos, COL_MENUCONTENT_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID, y + mheight * 3, mwidth, wpos, COL_MENUCONTENT_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID, y + mheight * 4, mwidth, hpos, COL_MENUCONTENT_TEXT); } #endif //#if ENABLE_PIP