From 9673fe4b0192ce9728fd54d51c0bad97b0de7afb Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 29 May 2013 21:18:39 +0200 Subject: [PATCH] - motorcontrol: using CComponentsHeader to paint header --- src/gui/motorcontrol.cpp | 18 ++++++++---------- src/gui/motorcontrol.h | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index acad895b6..012d3430b 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -171,7 +172,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) g_Zapit->tune_TP(TP); - paint(); + paintHead(); paintMenu(); paintStatus(); @@ -595,20 +596,17 @@ void CMotorControl::paintStatus() paintSeparator(xpos1, &ypos, width, g_Locale->getText(LOCALE_MOTORCONTROL_SETTINGS)); } -void CMotorControl::paint() +void CMotorControl::paintHead() { - ypos = y; - frameBuffer->paintBoxRel(x, ypos, width, hheight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + 10, ypos + hheight, width, g_Locale->getText(LOCALE_MOTORCONTROL_HEAD), COL_MENUHEAD, 0, true); // UTF-8 - frameBuffer->paintBoxRel(x, ypos + hheight, width, height - hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); - - ypos += hheight + (mheight >> 1) - 10; - ypos_menue = ypos; + CComponentsHeader header(x, y, width, hheight, LOCALE_MOTORCONTROL_HEAD, NULL /*no header icon*/); + header.paint(CC_SAVE_SCREEN_NO); } void CMotorControl::paintMenu() { - ypos = ypos_menue; + frameBuffer->paintBoxRel(x, y + hheight, width, height - hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + + ypos = y + hheight + (mheight >> 1) - 10; int xpos1 = x + 10; int xpos2 = xpos1 + 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("(7/yellow)"); diff --git a/src/gui/motorcontrol.h b/src/gui/motorcontrol.h index b69ad427f..84ffae7ba 100644 --- a/src/gui/motorcontrol.h +++ b/src/gui/motorcontrol.h @@ -68,7 +68,7 @@ class CMotorControl : public CMenuTarget int satfindpid; int lastsnr, lastsig; CProgressBar *snrscale, *sigscale; - void paint(); + void paintHead(void); void paintMenu(void); void paintStatus(void); void paintLine(int x, int *y, int width, const char *txt);