1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-04 23:37:10 +02:00

Selector previews are now shown with alpha 128 and fill the screen.

The alpha change is so that:
* some of the background is still visible, which includes the name of the
  application for which the selector is being called, its description, and
  text in the status bar;
* the preview, if bright, does not obscure the file names too much.

Selector previews are now shown full-screen (320x240) instead of being a
160x160px square on the right.
This commit is contained in:
Nebuleon Fumika 2014-07-13 20:49:26 +00:00 committed by Maarten ter Huurne
parent 7284104fd1
commit aca6025533

View File

@ -86,7 +86,6 @@ int Selector::exec(int startSelection) {
bg.convertToDisplayFormat();
Uint32 selTick = SDL_GetTicks(), curTick;
uint i, firstElement = 0, iY;
prepare(&fl,&screens,&titles);
@ -104,22 +103,21 @@ int Selector::exec(int startSelection) {
if (selected < firstElement)
firstElement = selected;
//Screenshot
if (selected-fl.dirCount()<screens.size()
&& !screens[selected-fl.dirCount()].empty()) {
Surface *screenshot = gmenu2x->sc[screens[selected-fl.dirCount()]];
if (screenshot)
screenshot->blitRight(
gmenu2x->s, 320, 0, 320, 240,
128u);
}
//Selection
iY = top + (selected - firstElement) * fontheight;
if (selected<fl.size())
gmenu2x->s->box(1, iY, 309, fontheight, gmenu2x->skinConfColors[COLOR_SELECTION_BG]);
//Screenshot
if (selected-fl.dirCount()<screens.size()
&& !screens[selected-fl.dirCount()].empty()) {
curTick = SDL_GetTicks();
if (curTick - selTick > 200) {
gmenu2x->sc[screens[selected-fl.dirCount()]]->blitRight(
gmenu2x->s, 311, 42, 160, 160,
min((curTick - selTick - 200) / 3, 255u));
}
}
//Files & Dirs
gmenu2x->s->setClipRect(0, top, 311, height);
for (i = firstElement; i < fl.size()
@ -149,7 +147,6 @@ int Selector::exec(int startSelection) {
case InputManager::UP:
if (selected == 0) selected = fl.size() -1;
else selected -= 1;
selTick = SDL_GetTicks();
break;
case InputManager::ALTLEFT:
@ -157,13 +154,11 @@ int Selector::exec(int startSelection) {
selected = 0;
else
selected -= nb_elements - 1;
selTick = SDL_GetTicks();
break;
case InputManager::DOWN:
if (selected+1>=fl.size()) selected = 0;
else selected += 1;
selTick = SDL_GetTicks();
break;
case InputManager::ALTRIGHT:
@ -171,7 +166,6 @@ int Selector::exec(int startSelection) {
selected = fl.size() - 1;
else
selected += nb_elements - 1;
selTick = SDL_GetTicks();
break;
case InputManager::CANCEL: