| 567 | std::string GetThemePath(); |
| 568 | |
| 569 | static void GetAvailableThemes(std::vector<AvailableTheme>* outThemes) |
| 570 | { |
| 571 | Guard::ArgumentNotNull(outThemes, GUARD_LINE); |
| 572 | |
| 573 | outThemes->clear(); |
| 574 | |
| 575 | NumPredefinedThemes = 0; |
| 576 | for (auto predefinedTheme : kPredefinedThemes) |
| 577 | { |
| 578 | AvailableTheme theme{}; |
| 579 | theme.Name = predefinedTheme.Theme->Name; |
| 580 | outThemes->push_back(std::move(theme)); |
| 581 | |
| 582 | NumPredefinedThemes++; |
| 583 | } |
| 584 | |
| 585 | auto themesPattern = Path::Combine(GetThemePath(), u8"*.json"); |
| 586 | auto scanner = Path::ScanDirectory(themesPattern, true); |
| 587 | while (scanner->Next()) |
| 588 | { |
| 589 | const auto& fileInfo = scanner->GetFileInfo(); |
| 590 | auto name = Path::GetFileNameWithoutExtension(fileInfo.Name); |
| 591 | |
| 592 | AvailableTheme theme{}; |
| 593 | theme.Name = name; |
| 594 | theme.Path = GetThemeFileName(name); |
| 595 | outThemes->push_back(std::move(theme)); |
| 596 | |
| 597 | if (Path::Equals(CurrentThemePath, scanner->GetPath())) |
| 598 | { |
| 599 | ActiveAvailableThemeIndex = outThemes->size() - 1; |
| 600 | } |
| 601 | } |
| 602 | } |
| 603 | |
| 604 | static void LoadTheme(UITheme* theme) |
| 605 | { |
no test coverage detected