MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / reload_theme_list

Method reload_theme_list

src/Toolbar.cpp:1794–1814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1792}
1793
1794void Toolbar::reload_theme_list() {
1795 themeData.selectedThemeIndex = 0;
1796
1797 themeData.themeDirList.clear();
1798 themeData.themeDirList.emplace_back("Default");
1799 std::filesystem::path themeDir = main.conf.configPath / "themes";
1800 if(std::filesystem::exists(themeDir) && std::filesystem::is_directory(themeDir)) {
1801 for(auto& theme : std::filesystem::recursive_directory_iterator(themeDir)) {
1802 std::string name = theme.path().stem().string();
1803 if(name != "Default") {
1804 themeData.themeDirList.emplace_back(name);
1805 if(name == main.conf.themeCurrentlyLoaded)
1806 themeData.selectedThemeIndex = themeData.themeDirList.size() - 1;
1807 }
1808 }
1809 }
1810 if(!main.g.load_theme(main.conf.configPath, main.conf.themeCurrentlyLoaded))
1811 themeData.selectedThemeIndex = 0;
1812
1813 themeData.openedSaveAsMenu = false;
1814}
1815
1816void Toolbar::file_picker_gui_refresh_entries() {
1817 auto& gui = main.g.gui;

Callers

nothing calls this directly

Calls 4

load_themeMethod · 0.80
clearMethod · 0.45
stringMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected