| 1506 | } |
| 1507 | |
| 1508 | static void languageMouseDown(const Window& self) |
| 1509 | { |
| 1510 | const auto lds = Localisation::getLanguageDescriptors(); |
| 1511 | uint8_t numLanguages = static_cast<uint8_t>(lds.size()); |
| 1512 | |
| 1513 | auto& dropdown = self.widgets[Widx::language]; |
| 1514 | Dropdown::show(self.x + dropdown.left, self.y + dropdown.top, dropdown.width() - 4, dropdown.height(), self.getColour(WindowColour::secondary), numLanguages - 1, 0x80); |
| 1515 | |
| 1516 | std::string& current_language = Config::get().language; |
| 1517 | |
| 1518 | for (uint8_t index = 1; index < numLanguages; index++) |
| 1519 | { |
| 1520 | auto& ld = lds[index]; |
| 1521 | Dropdown::add(index - 1, StringIds::dropdown_stringptr, (char*)ld.nativeName.c_str()); |
| 1522 | |
| 1523 | if (ld.locale == current_language) |
| 1524 | { |
| 1525 | Dropdown::setItemSelected(index - 1); |
| 1526 | } |
| 1527 | } |
| 1528 | } |
| 1529 | |
| 1530 | static void languageDropdown(Window& self, int16_t itemIndex) |
| 1531 | { |
no test coverage detected