| 49 | } |
| 50 | |
| 51 | static void updateRecentFiles(Menu_Bar::File_Context *fc) |
| 52 | { |
| 53 | /* Check for populated strings */ |
| 54 | for (int i=0; i < NUM_RECENTFILES; i++) |
| 55 | { |
| 56 | if (RecentFiles::paths[i] != NULL) |
| 57 | { |
| 58 | fc->menu_items[RECENTFILE_STARTIDX - 2].is_visible = true; // enable the recentfiles HEAD spacer |
| 59 | fc->menu_items[RECENTFILE_STARTIDX - 1].is_visible = true; // enable the recentfiles HEADLINE |
| 60 | fc->menu_items[RECENTFILE_STARTIDX + NUM_RECENTFILES].is_visible = true; // enable the end-of-recentfiles separator |
| 61 | fc->menu_items[RECENTFILE_STARTIDX + i].is_visible = true; // enable the entry |
| 62 | fc->menu_items[RECENTFILE_STARTIDX + i].clickable_text.str = RecentFiles::dnames[i]; |
| 63 | fc->menu_items[RECENTFILE_STARTIDX + i].clickable_text.init_width_height(); |
| 64 | } |
| 65 | else |
| 66 | { |
| 67 | fc->menu_items[RECENTFILE_STARTIDX + i].is_visible = false; // enable the entry |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | fc->menu.preload(fc->menu.created_at.x, fc->menu.created_at.y); |
| 72 | } |
| 73 | |
| 74 | int Menu_Bar::File_Context::openRecent(void *i) |
| 75 | { |
no test coverage detected