Small fixes

This commit is contained in:
louis 2014-01-10 23:07:52 +01:00
parent 84629bde6c
commit 15dbae66eb
5 changed files with 28 additions and 8 deletions

View File

@ -200,7 +200,7 @@ THEME_CLR(theme, clrRecMenuDayActive, 0xFF00FF00);
THEME_CLR(theme, clrRecMenuDayInactive, 0xFFFF0000);
THEME_CLR(theme, clrRecMenuDayHighlight, 0x44FFFFFF);
THEME_CLR(theme, clrRecMenuTextBack, 0xFF000000);
THEME_CLR(theme, clrRecMenuTextActiveBack, 0xFF404749);
THEME_CLR(theme, clrRecMenuTextActiveBack, 0xFF939376);
THEME_CLR(theme, clrRecMenuKeyboardBack, 0xFF000000);
THEME_CLR(theme, clrRecMenuKeyboardBorder, clrWhite);
THEME_CLR(theme, clrRecMenuKeyboardHigh, 0x40BB0000);

View File

@ -71,9 +71,12 @@ cRecMenuItemButton::cRecMenuItemButton(const char *text, eRecMenuState action, b
height = 3 * fontButtons->Height() / 2;
this->halfWidth = halfWidth;
this->alignLeft = alignLeft;
pixmapText = NULL;
}
cRecMenuItemButton::~cRecMenuItemButton(void) {
if (pixmapText)
osdManager.releasePixmap(pixmapText);
}
int cRecMenuItemButton::GetWidth(void) {
@ -85,20 +88,34 @@ void cRecMenuItemButton::SetPixmaps(void) {
x += width / 4;
width = width / 2;
}
if (!pixmap)
if (!pixmap) {
pixmap = osdManager.requestPixmap(4, cRect(x, y, width, height));
else
pixmapText = osdManager.requestPixmap(5, cRect(x, y, width, height));
} else {
pixmap->SetViewPort(cRect(x, y, width, height));
pixmapText->SetViewPort(cRect(x, y, width, height));
}
}
void cRecMenuItemButton::Draw(void) {
pixmapText->Fill(clrTransparent);
int y = (height - fontButtons->Height()) / 2;
int x;
if (!alignLeft)
x = (width - fontButtons->Width(*text)) / 2;
else
x = 10;
pixmap->DrawText(cPoint(x, y), *text, colorText, colorTextBack, fontButtons);
pixmapText->DrawText(cPoint(x, y), *text, colorText, colorTextBack, fontButtons);
}
void cRecMenuItemButton::Hide(void) {
pixmap->SetLayer(-1);
pixmapText->SetLayer(-1);
}
void cRecMenuItemButton::Show(void) {
pixmap->SetLayer(4);
pixmapText->SetLayer(5);
}
eRecMenuState cRecMenuItemButton::ProcessKey(eKeys Key) {
@ -673,7 +690,7 @@ void cRecMenuItemText::DrawValue(char *newValue) {
pixmapVal->Fill(clrBack);
int textX = pixmapVal->DrawPort().Width() - font->Width(newValue) - 10;
int textY = (pixmapVal->DrawPort().Height() - font->Height()) / 2;
pixmapVal->DrawText(cPoint(textX, textY), newValue, colorText, clrTransparent, font);
pixmapVal->DrawText(cPoint(textX, textY), newValue, colorText, clrBack, font);
}
void cRecMenuItemText::ActivateKeyboard(void) {
@ -736,7 +753,7 @@ void cRecMenuItemText::ActivateKeyboard(void) {
char *smsKeys = GetSMSKeys(num);
int smsKeysX = X + (gridWidth - fontSmall->Width(smsKeys))/2;
int smsKeysY = Y + gridHeight - fontSmall->Height() - 10;
pixmapKeyboard->DrawText(cPoint(smsKeysX, smsKeysY), smsKeys, theme.Color(clrRecMenuKeyboardBorder), colorTextBack, fontSmall);
pixmapKeyboard->DrawText(cPoint(smsKeysX, smsKeysY), smsKeys, theme.Color(clrRecMenuKeyboardBorder), theme.Color(clrRecMenuKeyboardBack), fontSmall);
delete[] smsKeys;
}
if (drawIcon) {

View File

@ -124,12 +124,15 @@ private:
bool halfWidth;
bool alignLeft;
const cFont *fontButtons;
cPixmap *pixmapText;
public:
cRecMenuItemButton(const char *text, eRecMenuState action, bool active, bool halfWidth = false, bool alignLeft = false, bool largeFont = false);
virtual ~cRecMenuItemButton(void);
int GetWidth(void);
void SetPixmaps(void);
void Draw(void);
void Hide(void);
void Show(void);
cString GetStringValue(void) { return text; };
eRecMenuState ProcessKey(eKeys Key);
};

View File

@ -38,7 +38,7 @@ clrRecMenuDayActive = FF00FF00
clrRecMenuDayInactive = FFFF0000
clrRecMenuDayHighlight = 44FFFFFF
clrRecMenuTextBack = FF000000
clrRecMenuTextActiveBack = FF404749
clrRecMenuTextActiveBack = FF939376
clrRecMenuKeyboardBack = FF000000
clrRecMenuKeyboardBorder = FFFFFFFF
clrRecMenuKeyboardHigh = 40BB0000

View File

@ -658,7 +658,7 @@ eOSState cTvGuideOsd::ProcessKey(eKeys Key) {
delete detailView;
detailView = NULL;
detailViewActive = false;
processKeyBlue();
state = processKeyBlue();
} else {
state = detailView->ProcessKey(Key);
if (state == osEnd) {