1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-05 04:25:19 +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 offsetY;
gmenu2x->bg->blit(gmenu2x->s, 0, 0);
drawTitleIcon("icons/explorer.png", true);
writeTitle(title);
writeSubTitle(subtitle);
Surface bg(gmenu2x->bg);
drawTitleIcon("icons/explorer.png", true, &bg);
writeTitle(title, &bg);
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,
// 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;
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;
ok = true;
while (!close) {
gmenu2x->bg->blit(gmenu2x->s,0,0);
writeTitle(title);
writeSubTitle(text);
drawTitleIcon(icon);
buttonbox->paint(gmenu2x->s, 5);
bg.blit(gmenu2x->s,0,0);
box.w = gmenu2x->font->getTextWidth(input) + 18;
box.x = 160 - box.w / 2;