diff --git a/UserInterfaceManager.cpp b/UserInterfaceManager.cpp index 9cefbba..2021c83 100644 --- a/UserInterfaceManager.cpp +++ b/UserInterfaceManager.cpp @@ -1600,10 +1600,10 @@ void Navigator::RenderNewPannel() // combo of recent media filenames ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - if (ImGui::BeginCombo("##RecentImport", "Recent files")) + if (ImGui::BeginCombo("##RecentImport", IMGUI_LABEL_RECENT_FILES)) { - for (std::list::iterator path = Settings::application.recentImport.filenames.begin(); - path != Settings::application.recentImport.filenames.end(); path++ ) + std::list recent = Settings::application.recentImport.filenames; + for (std::list::iterator path = recent.begin(); path != recent.end(); path++ ) { if ( SystemToolkit::file_exists(*path)) { std::string label = path->substr( path->size() - MIN( 35, path->size()) ); @@ -1796,8 +1796,8 @@ void Navigator::RenderMainPannel() if (ImGui::BeginCombo("##SelectionSession", SystemToolkit::trunc_filename(Settings::application.recentFolders.path, 25).c_str() )) { // Option 0 : recent files - if (ImGui::Selectable( ICON_FA_HISTORY " Recent Files") ) { - Settings::application.recentFolders.path = "Recent Files"; + if (ImGui::Selectable( ICON_FA_HISTORY IMGUI_LABEL_RECENT_FILES) ) { + Settings::application.recentFolders.path = IMGUI_LABEL_RECENT_FILES; selection_session_mode = 0; selection_session_mode_changed = true; } @@ -1830,7 +1830,7 @@ void Navigator::RenderMainPannel() if (ImGuiToolkit::IconToggle(12,14,11,14, &reset, tooltip)) { Settings::application.recentFolders.filenames.remove(Settings::application.recentFolders.path); if (Settings::application.recentFolders.filenames.empty()) { - Settings::application.recentFolders.path.assign("Recent Files"); + Settings::application.recentFolders.path.assign(IMGUI_LABEL_RECENT_FILES); selection_session_mode = 0; } else diff --git a/defines.h b/defines.h index 27a5220..543ffdf 100644 --- a/defines.h +++ b/defines.h @@ -8,7 +8,7 @@ #define APP_VERSION_MINOR 1 #define XML_VERSION_MAJOR 0 #define XML_VERSION_MINOR 1 -#define MAX_RECENT_HISTORY 16 +#define MAX_RECENT_HISTORY 20 #define MINI(a, b) (((a) < (b)) ? (a) : (b)) #define MAXI(a, b) (((a) > (b)) ? (a) : (b)) @@ -47,6 +47,7 @@ #define IMGUI_TITLE_SHADEREDITOR ICON_FA_CODE " Shader Editor" #define IMGUI_TITLE_PREVIEW ICON_FA_DESKTOP " Preview" #define IMGUI_TITLE_DELETE ICON_FA_BROOM " Delete?" +#define IMGUI_LABEL_RECENT_FILES " Recent files" #define IMGUI_RIGHT_ALIGN -3.5f * ImGui::GetTextLineHeightWithSpacing() #define IMGUI_NOTIFICATION_DURATION 1.5f #ifdef APPLE