Refactor XCUI editor module layout
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
#include <XCEditor/Collections/UIEditorScrollView.h>
|
||||
|
||||
#include <XCEngine/UI/Types.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace XCEngine::UI::Editor {
|
||||
|
||||
struct UIEditorScrollViewInteractionState {
|
||||
Widgets::UIEditorScrollViewState scrollViewState = {};
|
||||
::XCEngine::UI::UIPoint pointerPosition = {};
|
||||
float thumbDragStartPointerY = 0.0f;
|
||||
float thumbDragStartOffset = 0.0f;
|
||||
bool hasPointerPosition = false;
|
||||
};
|
||||
|
||||
struct UIEditorScrollViewInteractionResult {
|
||||
bool consumed = false;
|
||||
bool offsetChanged = false;
|
||||
bool focusChanged = false;
|
||||
bool startedThumbDrag = false;
|
||||
bool endedThumbDrag = false;
|
||||
Widgets::UIEditorScrollViewHitTarget hitTarget = {};
|
||||
float verticalOffset = 0.0f;
|
||||
};
|
||||
|
||||
struct UIEditorScrollViewInteractionFrame {
|
||||
Widgets::UIEditorScrollViewLayout layout = {};
|
||||
UIEditorScrollViewInteractionResult result = {};
|
||||
};
|
||||
|
||||
UIEditorScrollViewInteractionFrame UpdateUIEditorScrollViewInteraction(
|
||||
UIEditorScrollViewInteractionState& state,
|
||||
float& verticalOffset,
|
||||
const ::XCEngine::UI::UIRect& bounds,
|
||||
float contentHeight,
|
||||
const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents,
|
||||
const Widgets::UIEditorScrollViewMetrics& metrics = {});
|
||||
|
||||
} // namespace XCEngine::UI::Editor
|
||||
Reference in New Issue
Block a user