57 lines
1.5 KiB
C
57 lines
1.5 KiB
C
|
|
#pragma once
|
||
|
|
|
||
|
|
#include <XCEditor/Menu/UIEditorMenuPopup.h>
|
||
|
|
|
||
|
|
#include <XCEngine/UI/Types.h>
|
||
|
|
|
||
|
|
#include <cstddef>
|
||
|
|
#include <string>
|
||
|
|
#include <vector>
|
||
|
|
|
||
|
|
namespace XCEngine::UI {
|
||
|
|
|
||
|
|
struct UIInputEvent;
|
||
|
|
|
||
|
|
} // namespace XCEngine::UI
|
||
|
|
|
||
|
|
namespace XCEngine::UI::Editor {
|
||
|
|
|
||
|
|
struct UIEditorMenuPopupInteractionState {
|
||
|
|
std::string highlightedItemId = {};
|
||
|
|
std::string pressedItemId = {};
|
||
|
|
bool focused = false;
|
||
|
|
};
|
||
|
|
|
||
|
|
struct UIEditorMenuPopupInteractionRequest {
|
||
|
|
Widgets::UIEditorMenuPopupLayout layout = {};
|
||
|
|
std::vector<Widgets::UIEditorMenuPopupItem> items = {};
|
||
|
|
std::string preferredHighlightedItemId = {};
|
||
|
|
bool closeOnFocusLost = true;
|
||
|
|
bool activateOnPointerDown = false;
|
||
|
|
};
|
||
|
|
|
||
|
|
struct UIEditorMenuPopupInteractionResult {
|
||
|
|
bool consumed = false;
|
||
|
|
bool highlightChanged = false;
|
||
|
|
bool closeRequested = false;
|
||
|
|
bool itemActivated = false;
|
||
|
|
std::size_t activatedIndex = Widgets::UIEditorMenuPopupInvalidIndex;
|
||
|
|
std::string activatedItemId = {};
|
||
|
|
};
|
||
|
|
|
||
|
|
struct UIEditorMenuPopupInteractionFrame {
|
||
|
|
Widgets::UIEditorMenuPopupLayout layout = {};
|
||
|
|
Widgets::UIEditorMenuPopupState popupState = {};
|
||
|
|
UIEditorMenuPopupInteractionResult result = {};
|
||
|
|
};
|
||
|
|
|
||
|
|
void ResetUIEditorMenuPopupInteractionState(
|
||
|
|
UIEditorMenuPopupInteractionState& state);
|
||
|
|
|
||
|
|
UIEditorMenuPopupInteractionFrame UpdateUIEditorMenuPopupInteraction(
|
||
|
|
UIEditorMenuPopupInteractionState& state,
|
||
|
|
const UIEditorMenuPopupInteractionRequest& request,
|
||
|
|
const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents);
|
||
|
|
|
||
|
|
} // namespace XCEngine::UI::Editor
|