1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-09-30 01:09:27 +03:00

Set row size to 20px minimum in file list if browsing directories

This commit is contained in:
Paul Cercueil 2014-01-16 16:01:33 +01:00
parent 408a991a9d
commit e63ad99ba9
2 changed files with 9 additions and 4 deletions

View File

@ -60,6 +60,7 @@ bool BrowseDialog::exec()
const int topBarHeight = gmenu2x->skinConfInt["topBarHeight"];
rowHeight = gmenu2x->font->getHeight() + 1; // gp2x=15+1 / pandora=19+1
rowHeight = constrain(rowHeight, 20, 40);
numRows = (gmenu2x->resY - topBarHeight - 20) / rowHeight;
clipRect = (SDL_Rect) {
0,
@ -271,7 +272,7 @@ void BrowseDialog::paint()
icon = iconFile;
}
icon->blit(gmenu2x->s, 5, offsetY);
gmenu2x->s->write(gmenu2x->font, (*fl)[i], 24, offsetY + 8,
gmenu2x->s->write(gmenu2x->font, (*fl)[i], 24, offsetY + rowHeight / 2,
Font::HAlignLeft, Font::VAlignMiddle);
if (ts.available() && ts.pressed()

View File

@ -81,6 +81,8 @@ int Selector::exec(int startSelection) {
tie(top, height) = gmenu2x->getContentArea();
int fontheight = gmenu2x->font->getHeight();
if (link->getSelectorBrowser())
fontheight = constrain(fontheight, 20, 40);
unsigned int nb_elements = height / fontheight;
bg.convertToDisplayFormat();
@ -126,11 +128,13 @@ int Selector::exec(int startSelection) {
iY = i-firstElement;
if (fl.isDirectory(i)) {
gmenu2x->sc["imgs/folder.png"]->blit(gmenu2x->s, 4, top + (iY * fontheight));
gmenu2x->s->write(gmenu2x->font, fl[i], 21, top+(iY * fontheight), Font::HAlignLeft, Font::VAlignMiddle);
gmenu2x->s->write(gmenu2x->font, fl[i], 21,
top + (iY * fontheight) + (fontheight / 2),
Font::HAlignLeft, Font::VAlignMiddle);
} else
gmenu2x->s->write(gmenu2x->font, titles[i - fl.dirCount()], 4,
top + (iY * fontheight),
Font::HAlignLeft, Font::VAlignTop);
top + (iY * fontheight) + (fontheight / 2),
Font::HAlignLeft, Font::VAlignMiddle);
}
gmenu2x->s->clearClipRect();