From f57d4f2f7adb44b97f9696c94d3178e4ccebcd99 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 21 May 2023 18:41:43 +0200 Subject: [PATCH] impr: Manually sort file chooser popup list --- .../builtin/include/content/popups/popup_file_chooser.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/builtin/include/content/popups/popup_file_chooser.hpp b/plugins/builtin/include/content/popups/popup_file_chooser.hpp index ce464aeee..e52c040c2 100644 --- a/plugins/builtin/include/content/popups/popup_file_chooser.hpp +++ b/plugins/builtin/include/content/popups/popup_file_chooser.hpp @@ -13,7 +13,12 @@ namespace hex::plugin::builtin { : hex::Popup("hex.builtin.common.choose_file"), m_indices({ }), m_files(files), m_openCallback(callback), - m_validExtensions(validExtensions), m_multiple(multiple) { } + m_validExtensions(validExtensions), m_multiple(multiple) { + + std::sort(this->m_files.begin(), this->m_files.end(), [](const std::fs::path &a, const std::fs::path &b) { + return a.filename() < b.filename(); + }); + } void drawContent() override { bool doubleClicked = false;