1
0
mirror of synced 2024-12-01 02:37:18 +01:00

impr: Make file chooser filter bar be focused by default

This commit is contained in:
WerWolv 2024-02-25 14:34:09 +01:00
parent ea601a7d03
commit 29c7b342eb

View File

@ -46,6 +46,11 @@ namespace hex::ui {
void drawContent() override { void drawContent() override {
bool doubleClicked = false; bool doubleClicked = false;
if (m_justOpened) {
ImGui::SetKeyboardFocusHere();
m_justOpened = false;
}
ImGui::PushItemWidth(-1); ImGui::PushItemWidth(-1);
ImGuiExt::InputTextIcon("##search", ICON_VS_FILTER, m_filter); ImGuiExt::InputTextIcon("##search", ICON_VS_FILTER, m_filter);
ImGui::PopItemWidth(); ImGui::PopItemWidth();
@ -123,6 +128,7 @@ namespace hex::ui {
std::function<void(std::fs::path)> m_openCallback; std::function<void(std::fs::path)> m_openCallback;
std::vector<hex::fs::ItemFilter> m_validExtensions; std::vector<hex::fs::ItemFilter> m_validExtensions;
bool m_multiple = false; bool m_multiple = false;
bool m_justOpened = true;
}; };
class PopupNamedFileChooser : public PopupNamedFileChooserBase<PopupNamedFileChooser> { class PopupNamedFileChooser : public PopupNamedFileChooserBase<PopupNamedFileChooser> {