Update CMake configuration and CI workflows for improved compatibility and testing
- Updated minimum CMake version requirement from 3.5 to 3.16 to leverage new features and policies. - Enhanced CI workflows to include additional build configurations for Ubuntu and macOS, improving cross-platform support. - Added conditional linking for ImGui Test Engine in the CMakeLists, allowing for UI testing when enabled. - Refactored CMake commands in CI to ensure consistent policy version handling and streamlined build processes. - Introduced new constructors for MenuItem in the GUI to enhance menu item management and flexibility.
This commit is contained in:
@@ -87,6 +87,27 @@ struct MenuItem {
|
||||
std::function<void()> callback;
|
||||
std::function<bool()> enabled_condition = kDefaultEnabledCondition;
|
||||
std::vector<MenuItem> subitems;
|
||||
|
||||
// Default constructor
|
||||
MenuItem() = default;
|
||||
|
||||
// Constructor for basic menu items
|
||||
MenuItem(const std::string& name, const std::string& shortcut,
|
||||
std::function<void()> callback)
|
||||
: name(name), shortcut(shortcut), callback(callback) {}
|
||||
|
||||
// Constructor for menu items with enabled condition
|
||||
MenuItem(const std::string& name, const std::string& shortcut,
|
||||
std::function<void()> callback, std::function<bool()> enabled_condition)
|
||||
: name(name), shortcut(shortcut), callback(callback),
|
||||
enabled_condition(enabled_condition) {}
|
||||
|
||||
// Constructor for menu items with subitems
|
||||
MenuItem(const std::string& name, const std::string& shortcut,
|
||||
std::function<void()> callback, std::function<bool()> enabled_condition,
|
||||
std::vector<MenuItem> subitems)
|
||||
: name(name), shortcut(shortcut), callback(callback),
|
||||
enabled_condition(enabled_condition), subitems(std::move(subitems)) {}
|
||||
};
|
||||
using Menu = std::vector<MenuItem>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user