diff --git a/ui/xui/main-menu.cc b/ui/xui/main-menu.cc index c99f9ed10bb..c14c4bde47b 100644 --- a/ui/xui/main-menu.cc +++ b/ui/xui/main-menu.cc @@ -747,7 +747,7 @@ void MainMenuSnapshotsView::ClearSearch() } } -static int MainMenuSnapshotsViewUpdateSearchBox(ImGuiInputTextCallbackData *data) +int MainMenuSnapshotsView::OnSearchTextUpdate(ImGuiInputTextCallbackData *data) { GError *gerr = NULL; MainMenuSnapshotsView *win = (MainMenuSnapshotsView*)data->UserData; @@ -804,7 +804,7 @@ void MainMenuSnapshotsView::Draw() ImGui::PushFont(g_font_mgr.m_menu_font_small); ImGui::InputTextWithHint("##search", "Search or name new snapshot...", &m_search_buf, ImGuiInputTextFlags_CallbackEdit, - &MainMenuSnapshotsViewUpdateSearchBox, this); + &OnSearchTextUpdate, this); bool snapshot_with_create_name_exists = false; for (int i = 0; i < g_snapshot_mgr.m_snapshots_len; ++i) { diff --git a/ui/xui/main-menu.hh b/ui/xui/main-menu.hh index 63c4040fd04..7be564701ca 100644 --- a/ui/xui/main-menu.hh +++ b/ui/xui/main-menu.hh @@ -104,20 +104,21 @@ public: class MainMenuSnapshotsView : public virtual MainMenuTabView { protected: + GRegex *m_search_regex; uint32_t m_current_title_id; std::string m_current_title_name; std::string m_search_buf; -private: void ClearSearch(); void DrawSnapshotContextMenu(QEMUSnapshotInfo *snapshot, XemuSnapshotData *data, int current_snapshot_binding); + bool BigSnapshotButton(QEMUSnapshotInfo *snapshot, XemuSnapshotData *data, int current_snapshot_binding); + static int OnSearchTextUpdate(ImGuiInputTextCallbackData *data); public: - GRegex *m_search_regex; MainMenuSnapshotsView(); ~MainMenuSnapshotsView(); - bool BigSnapshotButton(QEMUSnapshotInfo *snapshot, XemuSnapshotData *data, int current_snapshot_binding); void Draw() override; + }; class MainMenuSystemView : public virtual MainMenuTabView