Refactor XCUI editor module layout
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
#pragma once
|
||||
|
||||
#include <XCEditor/Collections/UIEditorTreeView.h>
|
||||
|
||||
#include <XCEngine/UI/Types.h>
|
||||
#include <XCEngine/UI/Widgets/UIExpansionModel.h>
|
||||
#include <XCEngine/UI/Widgets/UIKeyboardNavigationModel.h>
|
||||
#include <XCEngine/UI/Widgets/UISelectionModel.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace XCEngine::UI::Editor {
|
||||
|
||||
struct UIEditorTreeViewInteractionState {
|
||||
Widgets::UIEditorTreeViewState treeViewState = {};
|
||||
::XCEngine::UI::Widgets::UIKeyboardNavigationModel keyboardNavigation = {};
|
||||
std::string selectionAnchorId = {};
|
||||
::XCEngine::UI::UIPoint pointerPosition = {};
|
||||
bool hasPointerPosition = false;
|
||||
};
|
||||
|
||||
struct UIEditorTreeViewInteractionResult {
|
||||
bool consumed = false;
|
||||
bool selectionChanged = false;
|
||||
bool expansionChanged = false;
|
||||
bool keyboardNavigated = false;
|
||||
bool secondaryClicked = false;
|
||||
bool renameRequested = false;
|
||||
Widgets::UIEditorTreeViewHitTarget hitTarget = {};
|
||||
std::string selectedItemId = {};
|
||||
std::string renameItemId = {};
|
||||
std::string toggledItemId = {};
|
||||
std::size_t selectedVisibleIndex = Widgets::UIEditorTreeViewInvalidIndex;
|
||||
};
|
||||
|
||||
struct UIEditorTreeViewInteractionFrame {
|
||||
Widgets::UIEditorTreeViewLayout layout = {};
|
||||
UIEditorTreeViewInteractionResult result = {};
|
||||
};
|
||||
|
||||
UIEditorTreeViewInteractionFrame UpdateUIEditorTreeViewInteraction(
|
||||
UIEditorTreeViewInteractionState& state,
|
||||
::XCEngine::UI::Widgets::UISelectionModel& selectionModel,
|
||||
::XCEngine::UI::Widgets::UIExpansionModel& expansionModel,
|
||||
const ::XCEngine::UI::UIRect& bounds,
|
||||
const std::vector<Widgets::UIEditorTreeViewItem>& items,
|
||||
const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents,
|
||||
const Widgets::UIEditorTreeViewMetrics& metrics = {});
|
||||
|
||||
} // namespace XCEngine::UI::Editor
|
||||
Reference in New Issue
Block a user