65 lines
2.4 KiB
C++
65 lines
2.4 KiB
C++
#pragma once
|
|
|
|
#include <XCEditor/Collections/UIEditorTabStrip.h>
|
|
|
|
#include <XCEngine/UI/DrawData.h>
|
|
#include <XCEngine/UI/Widgets/UIDragDropInteraction.h>
|
|
#include <XCEngine/UI/Widgets/UITabStripModel.h>
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace XCEngine::UI::Editor {
|
|
|
|
struct UIEditorTabStripInteractionState {
|
|
Widgets::UIEditorTabStripState tabStripState = {};
|
|
::XCEngine::UI::Widgets::UITabStripModel navigationModel = {};
|
|
::XCEngine::UI::Widgets::UIDragDropState reorderDragState = {};
|
|
Widgets::UIEditorTabStripHitTarget pressedTarget = {};
|
|
::XCEngine::UI::UIPoint pointerPosition = {};
|
|
std::size_t reorderSourceIndex = Widgets::UIEditorTabStripInvalidIndex;
|
|
std::size_t reorderPreviewIndex = Widgets::UIEditorTabStripInvalidIndex;
|
|
bool hasPointerPosition = false;
|
|
bool reorderCaptureActive = false;
|
|
};
|
|
|
|
struct UIEditorTabStripInteractionResult {
|
|
bool consumed = false;
|
|
bool selectionChanged = false;
|
|
bool closeRequested = false;
|
|
bool keyboardNavigated = false;
|
|
bool requestPointerCapture = false;
|
|
bool releasePointerCapture = false;
|
|
bool dragStarted = false;
|
|
bool dragEnded = false;
|
|
bool dragCanceled = false;
|
|
bool reorderRequested = false;
|
|
bool reorderPreviewActive = false;
|
|
Widgets::UIEditorTabStripHitTarget hitTarget = {};
|
|
std::string selectedTabId = {};
|
|
std::size_t selectedIndex = Widgets::UIEditorTabStripInvalidIndex;
|
|
std::string closedTabId = {};
|
|
std::size_t closedIndex = Widgets::UIEditorTabStripInvalidIndex;
|
|
std::string draggedTabId = {};
|
|
std::size_t dragSourceIndex = Widgets::UIEditorTabStripInvalidIndex;
|
|
std::size_t dropInsertionIndex = Widgets::UIEditorTabStripInvalidIndex;
|
|
std::size_t reorderToIndex = Widgets::UIEditorTabStripInvalidIndex;
|
|
std::size_t reorderPreviewIndex = Widgets::UIEditorTabStripInvalidIndex;
|
|
};
|
|
|
|
struct UIEditorTabStripInteractionFrame {
|
|
Widgets::UIEditorTabStripLayout layout = {};
|
|
UIEditorTabStripInteractionResult result = {};
|
|
bool focused = false;
|
|
};
|
|
|
|
UIEditorTabStripInteractionFrame UpdateUIEditorTabStripInteraction(
|
|
UIEditorTabStripInteractionState& state,
|
|
std::string& selectedTabId,
|
|
const ::XCEngine::UI::UIRect& bounds,
|
|
const std::vector<Widgets::UIEditorTabStripItem>& items,
|
|
const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents,
|
|
const Widgets::UIEditorTabStripMetrics& metrics = {});
|
|
|
|
} // namespace XCEngine::UI::Editor
|