1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-17 23:35:20 +02:00

Fix BrowseDialog and InputDialog rendering incorrectly

Parts of the background were still visible when the upper and
lower bars were transparent.
This commit is contained in:
Paul Cercueil 2014-01-16 01:16:27 +01:00
parent cfb96dd697
commit ae6f52a0a3
2 changed files with 15 additions and 11 deletions

View File

@ -227,12 +227,14 @@ void BrowseDialog::paint()
unsigned int firstElement, lastElement; unsigned int firstElement, lastElement;
unsigned int offsetY; unsigned int offsetY;
gmenu2x->bg->blit(gmenu2x->s, 0, 0); Surface bg(gmenu2x->bg);
drawTitleIcon("icons/explorer.png", true); drawTitleIcon("icons/explorer.png", true, &bg);
writeTitle(title); writeTitle(title, &bg);
writeSubTitle(subtitle); writeSubTitle(subtitle, &bg);
buttonBox.paint(&bg, 5);
buttonBox.paint(gmenu2x->s, 5); bg.convertToDisplayFormat();
bg.blit(gmenu2x->s,0,0);
// TODO(MtH): I have no idea what the right value of firstElement would be, // TODO(MtH): I have no idea what the right value of firstElement would be,
// but originally it was undefined and that is never a good idea. // but originally it was undefined and that is never a good idea.

View File

@ -151,15 +151,17 @@ bool InputDialog::exec() {
Uint32 caretTick = 0, curTick; Uint32 caretTick = 0, curTick;
bool caretOn = true; bool caretOn = true;
Surface bg(gmenu2x->bg);
drawTitleIcon(icon, false, &bg);
writeTitle(title, &bg);
writeSubTitle(text, &bg);
buttonbox->paint(&bg, 5);
bg.convertToDisplayFormat();
close = false; close = false;
ok = true; ok = true;
while (!close) { while (!close) {
gmenu2x->bg->blit(gmenu2x->s,0,0); bg.blit(gmenu2x->s,0,0);
writeTitle(title);
writeSubTitle(text);
drawTitleIcon(icon);
buttonbox->paint(gmenu2x->s, 5);
box.w = gmenu2x->font->getTextWidth(input) + 18; box.w = gmenu2x->font->getTextWidth(input) + 18;
box.x = 160 - box.w / 2; box.x = 160 - box.w / 2;