- scale with fontsize

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@359 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
striper
2010-02-17 11:01:36 +00:00
parent 32106f61d8
commit b26284ef99
2 changed files with 22 additions and 10 deletions

View File

@@ -54,15 +54,25 @@
CVfdControler::CVfdControler(const neutrino_locale_t Name, CChangeObserver* Observer) CVfdControler::CVfdControler(const neutrino_locale_t Name, CChangeObserver* Observer)
{ {
frameBuffer = CFrameBuffer::getInstance(); frameBuffer = CFrameBuffer::getInstance();
hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
observer = Observer; font_info = SNeutrinoSettings::FONT_TYPE_MENU;
name = Name; observer = Observer;
width = w_max(390, 0); name = Name;
height = h_max(hheight+ mheight* 3+ +mheight/2, 0);
x = frameBuffer->getScreenX() + ((frameBuffer->getScreenWidth()-width) >> 1); // calculate width
y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight()-height)>>1); lwidth = g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_LCDCONTROLER_BRIGHTNESSSTANDBY));
int tmpwidth = g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_LCDCONTROLER_BRIGHTNESS));
if (tmpwidth > lwidth) {
lwidth = tmpwidth;
}
width = w_max((210 + lwidth), 0); // fixme: get rid of hardcoded 210 (slider + slidertext)
height = h_max(hheight+ mheight* 3+ +mheight/2, 0);
x = frameBuffer->getScreenX() + ((frameBuffer->getScreenWidth()-width) >> 1);
y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight()-height)>>1);
brightness = CVFD::getInstance()->getBrightness(); brightness = CVFD::getInstance()->getBrightness();
brightnessstandby = CVFD::getInstance()->getBrightnessStandby(); brightnessstandby = CVFD::getInstance()->getBrightnessStandby();
@@ -257,7 +267,7 @@ void CVfdControler::paint()
void CVfdControler::paintSlider(int px, int py, unsigned int spos, float factor, const neutrino_locale_t text, bool selected) void CVfdControler::paintSlider(int px, int py, unsigned int spos, float factor, const neutrino_locale_t text, bool selected)
{ {
int startx = 200; int startx = lwidth + 15;
char wert[5]; char wert[5];
frameBuffer->paintBoxRel(px + startx, py, 120, mheight, COL_MENUCONTENT_PLUS_0); frameBuffer->paintBoxRel(px + startx, py, 120, mheight, COL_MENUCONTENT_PLUS_0);

View File

@@ -49,6 +49,8 @@ class CVfdControler : public CMenuTarget
int width; int width;
int height; int height;
int hheight,mheight; // head/menu font height int hheight,mheight; // head/menu font height
int font_info;
int lwidth;
unsigned char brightness; unsigned char brightness;
unsigned char brightnessstandby; unsigned char brightnessstandby;