Skip to content

Commit

Permalink
- Fix destination folder chooser appearance
Browse files Browse the repository at this point in the history
  • Loading branch information
emukidid committed May 2, 2018
1 parent 49fc622 commit d94e595
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cube/swiss/source/swiss.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,20 +434,26 @@ void select_dest_dir(file_handle* directory, file_handle* selection)
memcpy(&curDir, directory, sizeof(file_entry));
int i = 0, j = 0, max = 0, refresh = 1, num_files =0, idx = 0;

int fileListBase = 90;
int scrollBarHeight = (FILES_PER_PAGE*40);
int scrollBarTabHeight = (int)((float)scrollBarHeight/(float)num_files);
while(1){
// Read the directory
if(refresh) {
num_files = devices[DEVICE_DEST]->readDir(&curDir, &directories, IS_DIR);
sortFiles(directories, num_files);
refresh = idx = 0;
scrollBarTabHeight = (int)((float)scrollBarHeight/(float)num_files);
}
doBackdrop();
DrawEmptyBox(20,40, vmode->fbWidth-20, 450, COLOR_BLACK);
WriteFont(50, 55, "Enter directory and press X");
i = MIN(MAX(0,idx-FILES_PER_PAGE/2),MAX(0,num_files-FILES_PER_PAGE));
max = MIN(num_files, MAX(idx+FILES_PER_PAGE/2,FILES_PER_PAGE));
if(num_files > FILES_PER_PAGE)
DrawVertScrollBar(vmode->fbWidth-30, fileListBase, 16, scrollBarHeight, (float)((float)idx/(float)(num_files-1)),scrollBarTabHeight);
for(j = 0; i<max; ++i,++j) {
DrawSelectableButton(50,90+(j*50), 550, 90+(j*50)+50, getRelativeName((directories)[i].name), (i == idx) ? B_SELECTED:B_NOSELECT,-1);
DrawSelectableButton(50,fileListBase+(j*40), vmode->fbWidth-35, fileListBase+(j*40)+40, getRelativeName((directories)[i].name), (i == idx) ? B_SELECTED:B_NOSELECT,-1);
}
DrawFrameFinish();
while ((PAD_StickY(0) > -16 && PAD_StickY(0) < 16) && !(PAD_ButtonsHeld(0) & PAD_BUTTON_X) && !(PAD_ButtonsHeld(0) & PAD_BUTTON_A) && !(PAD_ButtonsHeld(0) & PAD_BUTTON_UP) && !(PAD_ButtonsHeld(0) & PAD_BUTTON_DOWN))
Expand Down

0 comments on commit d94e595

Please sign in to comment.