Add XCUI expansion state and coverage tests

This commit is contained in:
2026-04-05 07:29:27 +08:00
parent 646e5855ce
commit 511e94fd30
18 changed files with 1213 additions and 53 deletions

View File

@@ -0,0 +1,30 @@
#pragma once
#include <cstddef>
#include <string>
#include <string_view>
#include <unordered_set>
namespace XCEngine {
namespace UI {
namespace Widgets {
class UIExpansionModel {
public:
bool HasExpandedItems() const;
std::size_t GetExpandedCount() const;
bool IsExpanded(std::string_view id) const;
bool SetExpanded(std::string itemId, bool expanded);
bool Expand(std::string itemId);
bool Collapse(std::string itemId);
bool ToggleExpanded(std::string itemId);
bool Clear();
private:
std::unordered_set<std::string> m_expandedIds = {};
};
} // namespace Widgets
} // namespace UI
} // namespace XCEngine